Correctly showing 0 hours in 12 hour timestamps
authorDarren <darren@darrenwhitlen.com>
Sun, 2 Mar 2014 12:39:38 +0000 (12:39 +0000)
committerDarren <darren@darrenwhitlen.com>
Sun, 2 Mar 2014 12:39:38 +0000 (12:39 +0000)
client/src/views/channel.js

index ced59fc7eb2456d1f05c5e6b7e7f77e64055a688..45b585dfe0b9b51cfe2a6420837000a8378b12b8 100644 (file)
@@ -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 {