summaryrefslogtreecommitdiff
path: root/src/main.js
diff options
context:
space:
mode:
authorDerick Montague <derick.montague@ibm.com>2021-07-10 04:00:35 +0300
committerDerick Montague <derick.montague@ibm.com>2021-07-15 01:15:55 +0300
commit07b85ef34340906a551aa68c0729ab16f10e391c (patch)
tree86db7f43fe2b36779d492c30d25edbe588cc3cf5 /src/main.js
parent3b73cf834aaf9117d76bb0f590a076af6c28cd4e (diff)
downloadwebui-vue-07b85ef34340906a551aa68c0729ab16f10e391c.tar.xz
Fix cross-browser time formatting bug
To format the BMC time as 24 hour time, we used the `hour12` property. In Chrome, the time between 12:00 AM and 1:00 AM is displaye as 24:xx, instead of 00:xx. The cross-browser solution is to replace the `hour12` property with the `hourCycle` property so that all the time is formatted as 00:xx. Reference for Intl.DateTimeFormat constructor https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I68539d9602499dcb1bde9a4b01dd7a66fbc69d1a
Diffstat (limited to 'src/main.js')
-rw-r--r--src/main.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.js b/src/main.js
index 8c72580e..8fcb8089 100644
--- a/src/main.js
+++ b/src/main.js
@@ -71,7 +71,7 @@ Vue.filter('formatTime', function (value) {
if (isUtcDisplay) {
let timeOptions = {
timeZone: 'UTC',
- hour12: false,
+ hourCycle: 'h23',
};
return `${value.toLocaleTimeString('default', timeOptions)} UTC`;
}