mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
Merge branch 'develop' into feat/system-extension
This commit is contained in:
commit
6c7a20aa2e
@ -197,7 +197,7 @@ DatePicker.RangePicker = function RangePicker(props: any) {
|
||||
{ label: t('Next 90 days'), value: rangesValue.next90Days },
|
||||
];
|
||||
|
||||
const targetPicker = value ? inferPickerType(value?.[0]) : picker;
|
||||
const targetPicker = value ? inferPickerType(value?.[0], picker) : picker;
|
||||
const targetDateFormat = getPickerFormat(targetPicker) || format;
|
||||
const newProps: any = {
|
||||
utc,
|
||||
|
@ -271,7 +271,7 @@ function withParams(value: any[], params: { fieldOperator?: string; isParsingVar
|
||||
return value;
|
||||
}
|
||||
|
||||
export function inferPickerType(dateString: string, picker): 'year' | 'month' | 'quarter' | 'date' {
|
||||
export function inferPickerType(dateString: string, picker?): 'year' | 'month' | 'quarter' | 'date' {
|
||||
if (/^\d{4}$/.test(dateString)) {
|
||||
return 'year';
|
||||
} else if (/^\d{4}-\d{2}$/.test(dateString)) {
|
||||
@ -281,6 +281,6 @@ export function inferPickerType(dateString: string, picker): 'year' | 'month' |
|
||||
} else if (/^\d{4}-\d{2}-\d{2}$/.test(dateString)) {
|
||||
return 'date';
|
||||
} else {
|
||||
return picker;
|
||||
return picker || 'date';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user