Skip to content

Commit

Permalink
frontend: date time picker range TypeScript fix (#3035)
Browse files Browse the repository at this point in the history
Typescript fix so that the date time picker from MUI has the correct
typing for minDate and maxDate
  • Loading branch information
lucechal14 authored Jun 6, 2024
1 parent f1f3fb6 commit 991c8ed
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions frontend/packages/core/src/Input/date-time.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,19 @@ const PaddedTextField = styled(TextField)({
});

export interface DateTimePickerProps
extends Pick<
MuiDateTimePickerProps<Date, Date>,
"disabled" | "value" | "onChange" | "label" | "minDate" | "maxDate"
> {
extends Pick<MuiDateTimePickerProps<Date, Date>, "disabled" | "value" | "onChange" | "label"> {
allowEmpty?: boolean;
error?: boolean;
helperText?: string;
minDate?: Dayjs;
maxDate?: Dayjs;
}

const DateTimePicker = ({
onChange,
allowEmpty = false,
error = false,
helperText = "",
minDate = null,
maxDate = null,
...props
}: DateTimePickerProps) => (
<LocalizationProvider dateAdapter={AdapterDayjs}>
Expand Down

0 comments on commit 991c8ed

Please sign in to comment.