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