The same bug with maxDate <= value
https://jsfiddle.net/6kzs5ucm/
Hello,
const fp = flatpickr(".date-min", {
minDate: '2017-07-13'
});
fp.setDate(new Date('2017-07-12'))
This is intentional.
There's no point of minDate if the user can select dates past it.
If you need to override minDate, then clear it before using setDate().
Also, regarding
const fp2 = flatpickr(".date-max", {maxDate: '2017-07-20'});
fp2.setDate(new Date('2017-07-20'))
Note that flatpickr regards '2017-07-20' as '2017-07-20 00:00'.
Meanwhile,
new Date('2017-07-20')
// Wed Jul 19 2017 20:00:00 GMT-0400 (EDT)
...which is less than the date specified above.
@chmln I create PR and remove this limitation. User don't can select value less than minDate. And we can select value less than minDate from code with setDate. I think it's good. I know a problem with my PR, and i can fix it if this idea will like to you.
I have an issue when I use minDate (ex. today) and my defaultDate is set two days earlier (user set it two days ago and now is editing the form). My input field is empty than.
Is there any workaround for this?
Most helpful comment
I have an issue when I use minDate (ex. today) and my defaultDate is set two days earlier (user set it two days ago and now is editing the form). My input field is empty than.
Is there any workaround for this?