🩹(react) handle possible null date range
Exercise caution when dealing with date range values that may be null.
This commit is contained in:
committed by
NathanVss
parent
6c3259a4ac
commit
539f03eee1
@@ -116,7 +116,7 @@ const DatePickerAux = forwardRef(
|
||||
type="hidden"
|
||||
name={name && `${name}_start`}
|
||||
value={convertDateValueToString(
|
||||
pickerState.value.start,
|
||||
pickerState.value?.start ?? null,
|
||||
props.timezone,
|
||||
)}
|
||||
/>
|
||||
@@ -124,7 +124,7 @@ const DatePickerAux = forwardRef(
|
||||
type="hidden"
|
||||
name={name && `${name}_end`}
|
||||
value={convertDateValueToString(
|
||||
pickerState.value.end,
|
||||
pickerState.value?.end ?? null,
|
||||
props.timezone,
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -64,8 +64,8 @@ export const DateRangePicker = ({
|
||||
() =>
|
||||
!isFocused &&
|
||||
!pickerState.isOpen &&
|
||||
!pickerState.value.start &&
|
||||
!pickerState.value.end,
|
||||
!pickerState.value?.start &&
|
||||
!pickerState.value?.end,
|
||||
[pickerState.value, pickerState.isOpen, isFocused],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user