eui
eui copied to clipboard
[EuiDatePicker] Doesn't let you set a minDateTime
There's no easy way to set EuiDatePicker with the timepicker enabled to set a minimum date and time. You can do:
(If it's Aug 15 2019 at 5:30pm)
<EuiDatePicker
minDate={moment()}
minTime={moment()}
But that will prevent a user from selecting any time before 5:30pm on August 16, 17, 18, etc. as well.
To achieve the desired result, you have to do a weird workaround like:
<EuiDatePicker
selected={selectedTime}
minDate={moment()}
minTime={selectedTime.isSame(moment(), 'day')
? moment()
: moment.hour(0).minutes(0)
}
It's a valid point, for sure. It would necessitate a new prop, I think, because the current behavior of minDate
and minTime
is as intended (and pretty clear).
👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.
Leaving open as a TODO during the re-write of the component.
👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.
👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.
👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.
❌ We're automatically closing this issue due to lack of activity. Please comment if you feel this was done in error.
This still seems valid.
Due to the age of the issue and the valid workaround provided in the issue description, we're closing this as not planned. We'll gladly accept a PR, though.