From 36fb5f8723bc51750cb60d43b34ee7d1c462bc1a Mon Sep 17 00:00:00 2001 From: Darren Date: Sun, 2 Mar 2014 12:39:38 +0000 Subject: [PATCH] Correctly showing 0 hours in 12 hour timestamps --- client/src/views/channel.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 { -- 2.25.1