Skip to content

Commit

Permalink
Merge pull request #1679 from gchq/bugfix/BAI-1552-fix-delete-date-field
Browse files Browse the repository at this point in the history
fixed an issue where dates could not be deleted
  • Loading branch information
ARADDCC002 authored Dec 11, 2024
2 parents 3ff89e6 + cadd9bf commit 7bd55ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/MuiForms/DateSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface DateSelectorProps {
readOnly?: boolean
formContext?: any
value: string
onChange: (newValue: string) => void
onChange: (newValue: string | undefined) => void
InputProps?: any
}

Expand All @@ -26,6 +26,8 @@ export default function DateSelector(props: DateSelectorProps) {
const handleChange = (dateInput: Dayjs | null) => {
if (dateInput && dateInput.isValid()) {
onChange(dateInput.format('YYYY-MM-DD'))
} else {
onChange(undefined)
}
}

Expand Down

0 comments on commit 7bd55ea

Please sign in to comment.