diff --git a/components/vc-picker/RangePicker.tsx b/components/vc-picker/RangePicker.tsx index eba715fde..5ae49f1ff 100644 --- a/components/vc-picker/RangePicker.tsx +++ b/components/vc-picker/RangePicker.tsx @@ -315,7 +315,11 @@ function RangerPicker() { // 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); } } diff --git a/components/vc-picker/generate/dayjs.ts b/components/vc-picker/generate/dayjs.ts index 80266ff02..69bbd78ae 100644 --- a/components/vc-picker/generate/dayjs.ts +++ b/components/vc-picker/generate/dayjs.ts @@ -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; }