I have the following two functions...
function splitTitleString(titleText)
{
var titleText = titleText;
var temp = new Array();
temp = titleText.split(' - ');
var now = new Date().getTime();
var warningExpResp = 7200000;
var expRespDateTimeTicks = 0;
var slaDateTimeTicks = 0;
if(temp[0].length > 0)
{
slaDateTimeTicks = getTicks(temp[0]);
}
if(temp[1].length > 0)
{
expRespDateTimeTicks = getTicks(temp[1]);
}
var returnTicksArray = new Array(slaDateTimeTicks,expRespDateTimeTicks);
return returnTicksArray;
}
And...
function warning(titleText, serverDateTime, warningLengthMins, warningType)
{
var warningLengthTicks = warningLengthMins * (60 * 1000);
var ticks = new Array(splitTitleString(titleText));
var sla = parseInt(ticks[0]);
var resp = parseInt(ticks[1]);
var serverTicks = getTicks(serverDateTime);
// some other work....
}
The problem I have is 'resp' is always NaN even though 'ticks1' most definitely is?
PS: I'm not a JavaScript developer so please be nice if it's poor code.