summaryrefslogtreecommitdiff
path: root/tempo.js
diff options
context:
space:
mode:
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;