diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-06-22 16:35:00 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-06-22 16:37:07 (GMT) |
commit | 1c2f67f93e01a4b0f9f2bb690c77821fb6dd9326 (patch) | |
tree | 03cdabc7975469857713838fd6bbbeea8f6db185 /www/js/clock.js | |
parent | fa44b1f132b05bcc22e7f1a2ba29d0ef36885c58 (diff) |
fix date/time offset, add button for 'today'
Diffstat (limited to 'www/js/clock.js')
-rw-r--r-- | www/js/clock.js | 6 |
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()] + ', '; |