From: Darren Date: Sun, 2 Mar 2014 12:39:38 +0000 (+0000) Subject: Correctly showing 0 hours in 12 hour timestamps X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=36fb5f8723bc51750cb60d43b34ee7d1c462bc1a;p=KiwiIRC.git Correctly showing 0 hours in 12 hour timestamps --- diff --git a/client/src/views/channel.js b/client/src/views/channel.js index ced59fc..45b585d 100644 --- a/client/src/views/channel.js +++ b/client/src/views/channel.js @@ -147,7 +147,11 @@ _kiwi.view.Channel = _kiwi.view.Panel.extend({ } else { hour = msg.time.getHours(); pm = hour > 11; - hour = (hour === 0) ? 12 : hour % 12; + + hour = hour % 12; + if (hour === 0) + hour = 12; + if (pm) { msg.time_string = _kiwi.global.i18n.translate('client_views_panel_timestamp_pm').fetch(hour + ":" + msg.time.getMinutes().toString().lpad(2, "0") + ":" + msg.time.getSeconds().toString().lpad(2, "0")); } else {