summaryrefslogtreecommitdiff
path: root/www/js/clock.js
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-06-22 16:35:00 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-06-22 16:37:07 (GMT)
commit1c2f67f93e01a4b0f9f2bb690c77821fb6dd9326 (patch)
tree03cdabc7975469857713838fd6bbbeea8f6db185 /www/js/clock.js
parentfa44b1f132b05bcc22e7f1a2ba29d0ef36885c58 (diff)
fix date/time offset, add button for 'today'
Diffstat (limited to 'www/js/clock.js')
-rw-r--r--www/js/clock.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/www/js/clock.js b/www/js/clock.js
index d62acff..3fa5c24 100644
--- a/www/js/clock.js
+++ b/www/js/clock.js
@@ -29,8 +29,12 @@ function Clock() {
this.clock_rtt = 0;
this.state = 'NEW';
+ this.getRDTimeMS = function() {
+ return (+new Date()) + (this.last_message.tz_offset * 1000) + this.clock_offset;
+ }
+
this.redraw = function() {
- var rdtime_ms = (+new Date()) + (this.last_message.tz_offset * 1000) + this.clock_offset;
+ var rdtime_ms = this.getRDTimeMS()
var rdtime = new Date(rdtime_ms);
var date_str = weekday_short[rdtime.getUTCDay()] + ', ';