fix: 1、修复detection和entity搜索时,时间不是最新的问题

This commit is contained in:
刘洪洪
2024-09-03 14:07:47 +08:00
parent 1ff8c02aa6
commit 085a18931c
3 changed files with 26 additions and 7 deletions

View File

@@ -209,3 +209,15 @@ export function getDurationsTimeByType (number, type) {
}
return `P${T}${number}${switchValueByDateType(type)}`
}
export function getNowDate (timeFilter) {
if (timeFilter?.dateRangeValue > -1) {
return {
startTime: (new Date()).getTime() - (timeFilter.dateRangeValue * 60 * 1000),
endTime: (new Date()).getTime(),
dateRangeValue: { value: timeFilter.dateRangeValue }
}
} else {
return timeFilter
}
}