fix: datePicker support empty, close #6510

pull/6758/head
tangjinzhou 2023-04-27 22:39:23 +08:00
parent 80fbabc66f
commit 858169aee3
2 changed files with 6 additions and 1 deletions

View File

@ -315,7 +315,11 @@ function RangerPicker<DateType>() {
// Fill disabled unit
for (let i = 0; i < 2; i += 1) {
if (mergedDisabled.value[i] && !getValue(postValues, i) && !getValue(props.allowEmpty, i)) {
if (
mergedDisabled.value[i] &&
!getValue(postValues, i) &&
!getValue(props.allowEmpty, i)
) {
postValues = updateValues(postValues, props.generateConfig.getNow(), i);
}
}

View File

@ -123,6 +123,7 @@ function findTargetStr(val: string, index: number, segmentation: string) {
}
const toDateWithValueFormat = (val: string | Dayjs, valueFormat: string) => {
if (!val) return null;
if (dayjs.isDayjs(val)) {
return val;
}