diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-17 17:14:40 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-17 17:14:40 -0700 |
commit | cc8efd51e4ffb9bbe0fa9fef4936cf31f7ff21c8 (patch) | |
tree | 94f4e2c35dab248eab528e6a8f4aad7afff5e2cb /system/admin/static/common/js | |
parent | 6c6061400d641ddb347c208dc10c7e73bcebff6e (diff) |
updates to time utils
Diffstat (limited to 'system/admin/static/common/js')
-rw-r--r-- | system/admin/static/common/js/util.js | 9 |
1 files changed, 9 insertions, 0 deletions
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) { |