diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-02-26 13:11:45 -0800 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-02-26 13:11:45 -0800 |
commit | eabbe53c13e5fcf45a50b2163c871e6f9d55f991 (patch) | |
tree | a24f23561feca6e50084a1ca083911293114e17f /tempo.js | |
parent | 89ca2bfe654ee86b1190ebe28fd0038cb6fddc42 (diff) | |
download | tempo-eabbe53c13e5fcf45a50b2163c871e6f9d55f991.tar.gz tempo-eabbe53c13e5fcf45a50b2163c871e6f9d55f991.tar.xz |
Add option for 12-hour time.
Diffstat (limited to 'tempo.js')
-rw-r--r-- | tempo.js | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |