event log: js: clear interval when midnight passes

This commit is contained in:
Hylke Bons 2012-01-10 14:40:58 +00:00
parent 65215426c9
commit f43b71a375

View file

@ -7,12 +7,14 @@
$(document).ready(function () {
// Update the Today and Yesterday labels after midnight
setInterval (function(){
var midnight_interval = setInterval (function(){
var date = new Date();
if ((date.getTime() / 1000) >= <!-- $midnight -->) {
$("#today").html($("#today").attr("name"));
$("#yesterday").html($("#yesterday").attr("name"));
clearInterval(midnight_interval);
}
}, 60 * 1000);