fix short time range (#125)

This commit is contained in:
Fine0830 2022-07-21 10:06:51 +08:00 committed by GitHub
parent 017f5bf709
commit c7079ea17c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,8 +42,6 @@ const visGraph = ref<Nullable<any>>(null);
const oldVal = ref<{ width: number; height: number }>({ width: 0, height: 0 }); const oldVal = ref<{ width: number; height: number }>({ width: 0, height: 0 });
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const appStore = useAppStoreWithOut(); const appStore = useAppStoreWithOut();
const dateFormat = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") =>
new Date(dayjs(date).format(pattern));
const visDate = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") => const visDate = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") =>
dayjs(date).format(pattern); dayjs(date).format(pattern);
@ -67,8 +65,8 @@ function visTimeline() {
return { return {
id: index + 1, id: index + 1,
content: d.name, content: d.name,
start: dateFormat(Number(d.startTime)), start: new Date(Number(d.startTime)),
end: dateFormat(Number(d.endTime)), end: new Date(Number(d.endTime)),
data: d, data: d,
className: d.type, className: d.type,
}; };