fix short time range (#121)

This commit is contained in:
Fine0830
2022-07-19 12:47:03 +08:00
committed by GitHub
parent 42ead4a572
commit 4e022ff29a
2 changed files with 8 additions and 23 deletions

View File

@@ -115,8 +115,14 @@ function visTimeline() {
const i = events[index - 1 || 0];
for (const widget of widgets) {
let end = i.end;
if (!isNaN(index)) {
if (!i.end || i.end.getTime() - i.start.getTime() < 60000) {
end = i.start.getTime() + 60000;
}
}
const startTime = dateFormatTime(i.start, appStore.duration.step);
const endTime = dateFormatTime(i.end, appStore.duration.step);
const endTime = dateFormatTime(new Date(end), appStore.duration.step);
widget.filters = {
sourceId: dashboardStore.selectedGrid.id || "",
isRange: true,