packages/material-ui-lab/src/internal/pickers/date-utils.ts/parseRangeInputValue
export function parseRangeInputValue<TDate>(
  utils: MuiPickersAdapter,
  { value = [null, null] }: BasePickerProps<RangeInput<TDate>, DateRange<TDate>>,
) {
  return value.map((date) =>
    !utils.isValid(date) || date === null ? null : utils.startOfDay(utils.date(date)),
  ) as DateRange<TDate>;
}