Bug 343902 - Replace usage of Date.now() with 1.0-compatible code. Long live Mozilla 1.0!

ChatZilla only.
p=rdmsoft@bugs.rdmsoft.com (Robert Marshall)
r=silver
This commit is contained in:
silver%warwickcompsoc.co.uk 2006-07-14 12:02:17 +00:00
parent 0a81434c4b
commit 889b1142f2
2 changed files with 4 additions and 4 deletions

View File

@ -685,7 +685,7 @@ function onWhoTimeout()
net.primServ.LIGHTWEIGHT_WHO = true;
net.primServ.sendData("WHO " + chan.encodedName + "\n");
net.lastWhoCheckChannel = chan;
net.lastWhoCheckTime = Date.now();
net.lastWhoCheckTime = Number(new Date());
return;
}
@ -705,7 +705,7 @@ function onWhoTimeout()
var period = net.prefs["autoAwayPeriod"];
// The time since the last check, with a 5s error margin to
// stop us from not checking because the timer fired a tad early:
var waited = Date.now() - net.lastWhoCheckTime + 5000;
var waited = Number(new Date()) - net.lastWhoCheckTime + 5000;
if (net.isConnected() && (period != 0) && (period * 60000 < waited))
checkWho();
}

View File

@ -184,7 +184,7 @@ function init()
client.openLogFile(client);
// kick-start a log-check interval to make sure we change logfiles in time:
// It will fire 2 seconds past the next full hour.
setTimeout("checkLogFiles()", 3602000 - (Date.now() % 3600000));
setTimeout("checkLogFiles()", 3602000 - (Number(new Date()) % 3600000));
// Make sure the userlist is on the correct side.
updateUserlistSide(client.prefs["userlistLeft"]);
@ -4628,7 +4628,7 @@ function checkLogFiles()
// We use the same line again to make sure we keep a constant offset
// from the full hour, in case the timers go crazy at some point.
setTimeout("checkLogFiles()", 3602000 - (Date.now() % 3600000));
setTimeout("checkLogFiles()", 3602000 - (Number(new Date()) % 3600000));
}
CIRCChannel.prototype.getLCFunction =