Material ui Textfield type date, min not working

Mihail picture Mihail · Jul 16, 2019 · Viewed 9.8k times · Source

I am trying to add a min date from where the pick can start but the min date is not working.

<TextField
    id="date"
    type="date"
    defaultValue="2017-05-24"
    minDate="24/01/2019"
    InputLabelProps={{
      shrink: true
    }}
  />

Does anyone has any ideas?

Answer

Bello Damilola picture Bello Damilola · May 7, 2020

This should do the trick

<TextField
  InputProps={{inputProps: { min: "2020-05-01", max: "2020-05-04"} }}
  type="date"
  defaultValue="2019-05-24"
/>