Fixing bug in window.chat.setupTime

Problem:
"#chatinput time" use "toLocaleTimeString().slice(0, 5)" to get time, but hh:mm not always at 0-5 in all locale




Fix:
Use "toISOString().slice(11, 16)" to get time for "#chatinput time"
This commit is contained in:
Xelio
2013-02-08 13:50:06 +08:00
parent 5cd3b006da
commit d4a781d4dc

View File

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