summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
Diffstat (limited to 'src/store')
-rw-r--r--src/store/modules/GlobalStore.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js
index 14c10b7c..3dcbe040 100644
--- a/src/store/modules/GlobalStore.js
+++ b/src/store/modules/GlobalStore.js
@@ -1,4 +1,5 @@
import api from '@/store/api';
+import { getDateByTimeZone } from '@/utilities/_sila/convertTimeZone';
const HOST_STATE = {
on: 'xyz.openbmc_project.State.Host.HostState.Running',
@@ -7,14 +8,6 @@ const HOST_STATE = {
diagnosticMode: 'xyz.openbmc_project.State.Host.HostState.DiagnosticMode',
};
-const convertTZ = (date, tzString) => {
- return new Date(
- (typeof date === 'string' ? new Date(date) : date).toLocaleString('en-US', {
- timeZone: tzString,
- })
- );
-};
-
const serverStateMapper = (hostState) => {
switch (hostState) {
case HOST_STATE.on:
@@ -146,7 +139,7 @@ const GlobalStore = {
const bmcDateTime = response.data.DateTime;
const date = new Date(bmcDateTime);
const timeZone = getters.timeZone.split(' ')[1];
- commit('setBmcTime', convertTZ(date, timeZone));
+ commit('setBmcTime', getDateByTimeZone(date, timeZone));
dispatch('initLiveClock');
})
.catch((error) => console.log(error));