diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-07-18 03:52:58 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-07-18 03:52:58 (GMT) |
commit | d866b6f9b603da67fee2f200e888200e43b6e74d (patch) | |
tree | b41981defde2b5cc104a7fce606b9bf919b83be0 /www/js | |
parent | 66859aa93d66ba65e8791fe70de11162f845fc1a (diff) |
weekday short cleanup
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/utils.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/www/js/utils.js b/www/js/utils.js index 7d20309..b8bbd76 100644 --- a/www/js/utils.js +++ b/www/js/utils.js @@ -45,10 +45,11 @@ weekday[4] = "Donnerstag"; weekday[5] = "Freitag"; weekday[6] = "Samstag"; +var weekday_short = new Array('So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'); + function format_datetime(d) { if(Object.prototype.toString.call(d) === "[object Date]") { - var daynames = new Array('So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'); - var datetimestr = daynames[d.getDay()]; + var datetimestr = weekday_short[d.getDay()]; datetimestr += ' ' + Number(d.getDate()).pad(2); datetimestr += '.' + Number(d.getMonth() + 1).pad(2); datetimestr += '.' + d.getFullYear(); @@ -75,7 +76,6 @@ function msToTimeString(time) { function Clock(draw_callback) { this.draw_callback = draw_callback; - this.daynames = new Array('So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'); this.last_message = { t1: 0, t2: 0, t3: 0, t4: 0, tz_offset: 3600, week: 3 }; this.clock_offset = 0; @@ -85,7 +85,7 @@ function Clock(draw_callback) { var rdtime_ms = (+new Date()) + (this.last_message.tz_offset * 1000) + this.clock_offset; var rdtime = new Date(rdtime_ms); - var date_str = this.daynames[rdtime.getUTCDay()] + ', '; + var date_str = weekday_short[rdtime.getUTCDay()] + ', '; date_str += rdtime.getUTCDate() + '.' + (rdtime.getUTCMonth() + 1) + '.' + rdtime.getUTCFullYear(); var time_str = (rdtime.getUTCHours() > 9 ? ' ' : ' 0') + rdtime.getUTCHours(); |