Skip to content

Commit

Permalink
Set default value not value (#8644)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored Feb 16, 2022
1 parent 0949680 commit bdce803
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function PropertyFilterDatePicker({
const valueIsYYYYMMDD = narrowToString(value) && value?.length === 10

const [datePickerOpen, setDatePickerOpen] = useState(operator && isOperatorDate(operator) && autoFocus)
const [datePickerStartingValue] = useState(dayJSMightParse(value) ? dayjs(value) : null)
const [datePickerStartingValue] = useState(dayJSMightParse(value) ? dayjs(value) : undefined)
const [includeTimeInFilter, setIncludeTimeInFilter] = useState(!!value && !valueIsYYYYMMDD)
const [dateFormat, setDateFormat] = useState(valueIsYYYYMMDD ? onlyDateFormat : dateAndTimeFormat)

Expand All @@ -61,7 +61,7 @@ export function PropertyFilterDatePicker({
showTime={includeTimeInFilter}
showNow={false}
showToday={false}
value={datePickerStartingValue}
defaultValue={datePickerStartingValue}
onFocus={() => setDatePickerOpen(true)}
onBlur={() => setDatePickerOpen(false)}
onOk={(selectedDate) => {
Expand Down

0 comments on commit bdce803

Please sign in to comment.