mirror of
https://github.com/dataease/dataease.git
synced 2026-06-09 21:27:21 +08:00
fix(查询组件): 时间范围1号选择月初至昨天(当月)无法保存 #18178
This commit is contained in:
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user