fix: getRangePickerDefaultProps
parent
a5bef7d279
commit
bcd913dd8d
|
@ -1,3 +1,5 @@
|
||||||
|
import type { Dayjs } from 'dayjs';
|
||||||
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
/** 时间段选择器拓展 */
|
/** 时间段选择器拓展 */
|
||||||
|
@ -6,21 +8,27 @@ export function getRangePickerDefaultProps() {
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
placeholder: ['开始时间', '结束时间'],
|
placeholder: ['开始时间', '结束时间'],
|
||||||
ranges: {
|
ranges: {
|
||||||
今天: [dayjs().startOf('day'), dayjs().endOf('day')],
|
今天: () =>
|
||||||
'最近 7 天': [
|
[dayjs().startOf('day'), dayjs().endOf('day')] as [Dayjs, Dayjs],
|
||||||
dayjs().subtract(7, 'day').startOf('day'),
|
'最近 7 天': () =>
|
||||||
dayjs().endOf('day'),
|
[dayjs().subtract(7, 'day').startOf('day'), dayjs().endOf('day')] as [
|
||||||
],
|
Dayjs,
|
||||||
'最近 30 天': [
|
Dayjs,
|
||||||
dayjs().subtract(30, 'day').startOf('day'),
|
],
|
||||||
dayjs().endOf('day'),
|
'最近 30 天': () =>
|
||||||
],
|
[dayjs().subtract(30, 'day').startOf('day'), dayjs().endOf('day')] as [
|
||||||
昨天: [
|
Dayjs,
|
||||||
dayjs().subtract(1, 'day').startOf('day'),
|
Dayjs,
|
||||||
dayjs().subtract(1, 'day').endOf('day'),
|
],
|
||||||
],
|
昨天: () =>
|
||||||
本周: [dayjs().startOf('week'), dayjs().endOf('day')],
|
[
|
||||||
本月: [dayjs().startOf('month'), dayjs().endOf('day')],
|
dayjs().subtract(1, 'day').startOf('day'),
|
||||||
|
dayjs().subtract(1, 'day').endOf('day'),
|
||||||
|
] as [Dayjs, Dayjs],
|
||||||
|
本周: () =>
|
||||||
|
[dayjs().startOf('week'), dayjs().endOf('day')] as [Dayjs, Dayjs],
|
||||||
|
本月: () =>
|
||||||
|
[dayjs().startOf('month'), dayjs().endOf('day')] as [Dayjs, Dayjs],
|
||||||
},
|
},
|
||||||
showTime: {
|
showTime: {
|
||||||
defaultValue: [
|
defaultValue: [
|
||||||
|
|
Loading…
Reference in New Issue