From 7b944575048330509c82005cfc9290bde400be5a Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Fri, 17 Sep 2010 13:58:44 -0300 Subject: [PATCH] Time of chat now display the left zero of minutes --- public/javascripts/chat.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/javascripts/chat.js b/public/javascripts/chat.js index b6ca10d..f23aa22 100644 --- a/public/javascripts/chat.js +++ b/public/javascripts/chat.js @@ -70,7 +70,7 @@ jQuery(function($) { } else { var time = new Date(); - time = time.getHours() + ':' + time.getMinutes(); + time = time.getHours() + ':' + checkTime(time.getMinutes()); name = $('#' + jid_id).html(); identifier = Strophe.getNodeFromJid(jid); if (who === "self") { @@ -418,3 +418,10 @@ jQuery(function($) { }); }); + +function checkTime(i) { + if (i<10) { + i="0" + i; + } + return i; +} -- libgit2 0.21.2