diff --git a/src/layout/components/NavBar.vue b/src/layout/components/NavBar.vue index 6b99d227..19355743 100644 --- a/src/layout/components/NavBar.vue +++ b/src/layout/components/NavBar.vue @@ -62,7 +62,10 @@ const appStore = useAppStoreWithOut(); const route = useRoute(); const pageName = ref(""); const timeRange = ref(0); -const time = ref([appStore.duration.start, appStore.duration.end]); +const time = ref([ + appStore.durationRow.start, + appStore.durationRow.end, +]); resetDuration(); getVersion(); @@ -106,12 +109,12 @@ function resetDuration() { const d = JSON.parse(duration); appStore.updateDurationRow({ - start: getLocalTime(d.utc, d.start), - end: getLocalTime(d.utc, d.end), + start: new Date(d.start), + end: new Date(d.end), step: d.step, }); appStore.updateUTC(d.utc); - time.value = [getLocalTime(d.utc, d.start), getLocalTime(d.utc, d.end)]; + time.value = [new Date(d.start), new Date(d.end)]; } } diff --git a/src/utils/dateFormat.ts b/src/utils/dateFormat.ts index 0cc0abda..f9b597c7 100644 --- a/src/utils/dateFormat.ts +++ b/src/utils/dateFormat.ts @@ -15,7 +15,6 @@ * limitations under the License. */ import dayjs from "dayjs"; -import getLocalTime from "@/utils/localtime"; export default function dateFormatStep( date: Date, step: string, @@ -102,8 +101,5 @@ export const dateFormatTime = (date: Date, step: string): string => { return ""; }; -export const dateFormat = ( - date: number, - utc: string, - pattern = "YYYY-MM-DD HH:mm:ss" -) => dayjs(getLocalTime(utc, new Date(date))).format(pattern); +export const dateFormat = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") => + dayjs(new Date(date)).format(pattern); diff --git a/src/views/alarm/Content.vue b/src/views/alarm/Content.vue index 23de0f36..d21e9979 100644 --- a/src/views/alarm/Content.vue +++ b/src/views/alarm/Content.vue @@ -145,16 +145,14 @@ limitations under the License. -->