I am using MUI’s DateTimePicker , and for time selection i am getting an analog clock. Is there a way through which i can get the digital clock.
I took help of chatGPT but, it didnt provided me a working solution. There was a Answer available on StackOverflow, but that also didnt work.
My code looks like this
views = ['day', 'hours', 'minutes'],
<DateTimePicker
label='Start Date'
value={new Date(selectedDateTime.startTime)}
views={views}
minDate={minDate}
maxDateTime={dayjs(new Date())}
onChange={handleStartDateChange}
renderInput={(props) => <TextField {...props} />}
/>
Seems like this is what you want:
<DemoItem label="Desktop variant">
<DesktopDateTimePicker defaultValue={dayjs('2022-04-17T15:30')} />
</DemoItem>
Read documentation here:
https://mui.com/x/react-date-pickers/date-time-picker/#available-components