react-datetime-picker
react-datetime-picker copied to clipboard
Is there the possibility to synchronize two date-time-pickers?
Hello everyone,
I'm currently using two react-datetime-picker instances and want to synchronize the resulting dates with one another. The first datetime-picker is used for the start-date, while the second one maintains the end-date. I now want to ensure (through the UI) that the start date always needs to be prior to the end-date and vice versa. This generally works by specifiying minDate
and maxDate
, but unfortunately it doesn't work for the case when both dates are equal and only the time differs.
Examples:
start: "2020-04-24 13:30"
end: "2020-04-24 13:29"
start:"2020-04-24 13:31" end: "2020-04-24 13:30"
Is there the possibility to prevent such behavior? On further investigation i found out, that the react-time-picker has minTime
and maxTime
props, but those wouldn't help either, because i would only need the check in the specific case of start and end date being the same day. Am i overseeing something?
I believe minDate should prevent the user from submitting a date that's smaller than minDate 🤔 If it doesn't, I'd consider this a bug.
By the way, there's React-DateTimeRange-Picker too :)
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.