I have 2 DateTimePicker objects on my form, one for start time and one for end time ... At the moment they work perfect, but i am able to choose an end time that is behind the start time ... When i do this my calculations error. Is there any way to change the end_time picker to match the start_time picker after its been selected, and not allow it to choose date time before the start_time?
<Controller
control={control}
name='start_time'
defaultValue={new Date(now.toLocaleString('en-US', { timeZone: timezone }))}
render={({ field: { onChange, value } }) => (
<DateTimePicker
onChange={onChange}
value={value ? new Date(value) : null}
format="dd-MM-y h:mm a"
/>
)}
/>
<Controller
control={control}
name='end_time'
defaultValue={new Date(now.toLocaleString('en-US', { timeZone: timezone }))}
render={({ field: { onChange, value } }) => (
<DateTimePicker
onChange={onChange}
value={value ? new Date(value) : null}
format="dd-MM-y h:mm a"
/>
)}
/>