diff options
Diffstat (limited to 'tempo.js')
-rw-r--r-- | tempo.js | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -1,12 +1,9 @@ +var timeformat = null; var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; -var timeformat = null; function padTime(x) { - if (x < 10) - return '0' + x; - else - return x; + return (x < 10) ? '0' + x : x; } function updateTime() { @@ -20,7 +17,7 @@ function updateTime() { var dm = date.getMonth(); var dy = date.getFullYear(); - if (timeformat == 12) + if (timeformat == 12) // default to 24 h = (h + 11) % 12 + 1; var str_t = padTime(h) + ' ' + padTime(m) + @@ -35,9 +32,8 @@ function startTempo() { timeformat = localStorage['timeformat']; updateTime(); - setTimeout(function() { updateTime(); setInterval(updateTime, 1000) }, - 1000 - new Date().getTime() % 1000); + 1000 - (new Date()).getTime() % 1000); } window.onload = startTempo; |