mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix: inferPickerType (#6244)
This commit is contained in:
parent
dcd2279eeb
commit
1955499178
@ -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