summaryrefslogtreecommitdiff
path: root/tempo.js
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-04-10 06:29:58 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-04-10 06:39:00 -0700
commitee0e4763c44ac38c05c92900f6c1b9d3e2d26069 (patch)
tree3fac06323ece0b19e903442ff027c9bd12d9ad88 /tempo.js
parenta9358b6ffad0ac98a4e60f43beda24a22bc0224d (diff)
downloadtempo-ee0e4763c44ac38c05c92900f6c1b9d3e2d26069.tar.gz
tempo-ee0e4763c44ac38c05c92900f6c1b9d3e2d26069.tar.xz
add favicon; minor cleanup
Diffstat (limited to 'tempo.js')
-rw-r--r--tempo.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/tempo.js b/tempo.js
index 40b426a..f280142 100644
--- a/tempo.js
+++ b/tempo.js
@@ -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) + '&nbsp;&nbsp;' + 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;