fix(查询组件): 时间范围1号选择月初至昨天(当月)无法保存 #18178

This commit is contained in:
dataeaseShu
2026-04-03 16:44:12 +08:00
committed by dataeaseShu
parent a7100f5040
commit 2e2e3da1a2

View File

@@ -71,7 +71,12 @@ function getCustomRange(relativeToCurrentRange: string): [Date, Date] {
case 'YearToThisMonth':
return [new Date(dayjs().startOf('year').format('YYYY/MM/DD HH:mm:ss')), getThisEnd('month')]
case 'monthToYesterday':
return [new Date(dayjs().startOf('month').format('YYYY/MM/DD HH:mm:ss')), getLastEnd('day')]
const sm = new Date(dayjs().startOf('month').format('YYYY/MM/DD HH:mm:ss'))
const ld = getLastEnd('day')
if (+sm > +ld) {
return [sm, sm]
}
return [sm, ld]
case 'today':
return [getThisStart('day'), getThisEnd('day')]
case 'yesterday':