0

I want to highlight the week from Monday to Sunday when selecting a date in MUI (5.0.20) DesktopDatePicker. What should I add to the DesktopDatePicker to make it highlight the week of selected date?

Here is my current DesktopDatePicker component:

<LocalizationProvider dateAdapter={AdapterMoment}>
  <DesktopDatePicker
    label={label}
    inputFormat={inputFormat}
    value={currentValue}
    {...custom}
    className={classes.datePicker}
    renderDay={typeof renderDay === 'function' ? renderDay : getPickerWindow}
    allowSameDateSelection={allowSameDateSelection}
    renderInput={(params) => (
      <div>
        <TextField
          variant={variant}
          {...params}
          InputProps={{
            ...params.InputProps,
            value: currentValue,
            className: classes.date,
          }}
          className={classes.date}
        />
        {error && touched && (<FormHelperText error>{error}</FormHelperText>)}
      </div>
    )}
    onChange={(changedValue) => {
      if (!changedValue) return input.onChange(undefined);
      setCurrentValue(changedValue.format(inputFormat));
      return input.onChange(changedValue);
    }}
    {...inputData}
  />
</LocalizationProvider>
Dmitry
  • 809
  • 3
  • 16
  • 29

0 Answers0