Merge branch 'develop' into feat/system-extension

This commit is contained in:
katherinehhh 2025-02-19 10:33:43 +08:00
commit 6c7a20aa2e
2 changed files with 3 additions and 3 deletions

View File

@ -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,

View File

@ -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';
}
}