diff options
author | Maksim Zakharov <m.zakharov@IBS.RU> | 2022-06-01 17:40:28 +0300 |
---|---|---|
committer | Maksim Zakharov <m.zakharov@IBS.RU> | 2022-06-01 17:49:04 +0300 |
commit | 0cbf1713dc23e0039653891fab1fa2c52b4bfaf3 (patch) | |
tree | 94f31f3d6935a130d49704c51512016814df15eb /src/main.js | |
parent | c4d70da69a3c86f8c07ccdb0f09b755dd99b2155 (diff) | |
download | webui-vue-0cbf1713dc23e0039653891fab1fa2c52b4bfaf3.tar.xz |
Add PopoverSlot restyled DateTime and ServerPowerOrerations pages add reload BMC.
Diffstat (limited to 'src/main.js')
-rw-r--r-- | src/main.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main.js b/src/main.js index 79bab44f..3d357157 100644 --- a/src/main.js +++ b/src/main.js @@ -85,6 +85,23 @@ Vue.filter('formatTime', function (value) { } }); +Vue.filter('formatTimeShort', function (value) { + const isUtcDisplay = store.getters['global/isUtcDisplay']; + + if (value instanceof Date) { + if (isUtcDisplay) { + let timeOptions = { + timeZone: 'UTC', + hourCycle: 'h23', + }; + return `${value.toLocaleTimeString('default', timeOptions)}`; + } + const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; + // const shortTz = Vue.filter('shortTimeZone')(value); + const pattern = `HH:mm:ss`; + return format(value, pattern, { timezone }).replace('GMT', 'UTC'); + } +}); // Plugins Vue.use(AlertPlugin); Vue.use(BadgePlugin); |