summaryrefslogtreecommitdiff
path: root/tempo.js
diff options
context:
space:
mode:
Diffstat (limited to 'tempo.js')
-rw-r--r--tempo.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/tempo.js b/tempo.js
index 6fed6ad..0d90f5f 100644
--- a/tempo.js
+++ b/tempo.js
@@ -13,6 +13,8 @@ function padTime(x) {
}
function updateTime() {
+ var timeformat = localStorage['timeformat'];
+
var date = new Date();
var h = date.getHours();
@@ -25,6 +27,10 @@ function updateTime() {
var str_d = dd + " " + months[dm] + " " + dy;
+ if(timeformat == '12') {
+ h = (h + 11) % 12 + 1;
+ }
+
document.getElementById("h").innerHTML = padTime(h);
document.getElementById("m").innerHTML = padTime(m);
document.getElementById("s").innerHTML = padTime(s);