From d4a781d4dcc8d9d769d1ebc3b7fa22164febc8e1 Mon Sep 17 00:00:00 2001 From: Xelio Date: Fri, 8 Feb 2013 13:50:06 +0800 Subject: [PATCH] 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" --- code/chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/chat.js b/code/chat.js index e1c52da5..46b4db11 100644 --- a/code/chat.js +++ b/code/chat.js @@ -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); };