diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-10 06:29:58 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-10 06:39:00 -0700 |
commit | ee0e4763c44ac38c05c92900f6c1b9d3e2d26069 (patch) | |
tree | 3fac06323ece0b19e903442ff027c9bd12d9ad88 /tempo.js | |
parent | a9358b6ffad0ac98a4e60f43beda24a22bc0224d (diff) | |
download | tempo-ee0e4763c44ac38c05c92900f6c1b9d3e2d26069.tar.gz tempo-ee0e4763c44ac38c05c92900f6c1b9d3e2d26069.tar.xz |
add favicon; minor cleanup
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; |