I tried changing the mui datepicker to a different format, but it always fails. this code work for me
const Step2 = ({handlechange,value: {startTime}}) =>
{
return(
<TextField
fullWidth
required
color="success"
size="small"
label="Start Time"
name='startTime'
type="datetime-local"
value={startTime || '2022-06-24T10:30' }
InputLabelProps={{
shrink: true,
}}
margin="normal"
onChange={handlechange}
/>
)
}
export default Step2
but how to implement to MUI Datetime picker to this
const Step2 = ({handlechange,value: {startTime}}) =>
{
const [value, setValue] = React.useState(new Date());
return (
<LocalizationProvider dateAdapter={AdapterDateFns}>
<DateTimePicker
renderInput={(props) => <TextField {...props} />}
label="DateTimePicker"
value={value}
onChange={(newValue) => {
setValue(newValue);
}}/>
</LocalizationProvider>)
}
export default Step2