3
  • React:18.2.0
  • mui/material: 5.10.5
  • date-fns: 2.29.3
  • date-io/date-fns: 2.16.0
  • formik: 2.2.9

I want to use DateTimePicker in my project. i want enter time this format: Hour:Minute:second but Currently, I can only enter 00:00 Hour:Minute. how can fix it ? Also, I checked the mui documentation, but I didn't find an answer. enter image description here

I tried

<DateTimePicker
  mask="____/__/__ __:__:__"
  format="yyyy/MM/dd HH:mm:ss"
  ampm={false}
    openTo="year"
     views={[
     'year',
     'month',
     'day',
     'hours',
      'minutes',
     'seconds'
          ]}
/>

but didnt work.

Olivier Tassinari
  • 8,238
  • 4
  • 23
  • 23

1 Answers1

1

You need to add inputFormat="yyyy/MM/dd HH:mm:ss"

todevv
  • 400
  • 2
  • 11