react-datetime-picker icon indicating copy to clipboard operation
react-datetime-picker copied to clipboard

Is there the possibility to synchronize two date-time-pickers?

Open KezerSa72274 opened this issue 4 years ago • 1 comments

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?

KezerSa72274 avatar Apr 24 '20 13:04 KezerSa72274

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 :)

wojtekmaj avatar Apr 26 '20 12:04 wojtekmaj

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.

github-actions[bot] avatar Jan 09 '23 00:01 github-actions[bot]