get time for chat input differently, so it reflects the local time

This commit is contained in:
Stefan Breunig
2013-02-08 17:25:35 +01:00
parent 0720be5093
commit 9316d49e68

View File

@ -616,7 +616,9 @@ window.chat.setupTime = function() {
var updateTime = function() { var updateTime = function() {
if(window.isIdle()) return; if(window.isIdle()) return;
var d = new Date(); var d = new Date();
inputTime.text(d.toISOString().slice(11, 16)); var h = d.getHours() + ''; if(h.length === 1) h = '0' + h;
var m = d.getMinutes() + ''; if(m.length === 1) m = '0' + m;
inputTime.text(h+':'+m);
// update ON the minute (1ms after) // update ON the minute (1ms after)
setTimeout(updateTime, (60 - d.getSeconds()) * 1000 + 1); setTimeout(updateTime, (60 - d.getSeconds()) * 1000 + 1);
}; };