From cc8efd51e4ffb9bbe0fa9fef4936cf31f7ff21c8 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Mon, 17 Oct 2016 17:14:40 -0700 Subject: updates to time utils --- system/admin/static/common/js/util.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'system/admin/static/common/js') diff --git a/system/admin/static/common/js/util.js b/system/admin/static/common/js/util.js index 7bd821d..7f4c8ab 100644 --- a/system/admin/static/common/js/util.js +++ b/system/admin/static/common/js/util.js @@ -31,7 +31,16 @@ function getPartialTime(unix) { if (hours < 10) { hours = "0" + String(hours); } + t.hh = hours; + if (hours > 12) { + t.hh = hours - 12; + t.pd = "PM"; + } else if (hours === 12) { + t.pd = "PM"; + } else if (hours < 12) { + t.pd = "AM"; + } var minutes = date.getMinutes(); if (minutes < 10) { -- cgit v1.2.3