Would be great to have the ability to limit months navigation to a specific range.
Could be achieved by min / max date props.
Thanks!
If you're in April, and all of March is out of range, but February is in range, what happens when you try to go back a month?
@ljharb rephrased the issue.
min/max date props might indeed make sense, thanks.
min and max is for some cases a must have.. any progress on this?
Nobody鈥檚 submitted a PR yet.
This is on my team's list of things we'd like to work on at some point but it's pretty low in priority so if someone else needs it faster I'd suggest submitting a PR. Otherwise I can get it it eventually. :woman_shrugging:
Same here --- it is on the list, but it is not yet a high priority. The fastest way to get to it would be to submit a PR! :)
While this is a nice addition to development experience, if I get it correctly, it is easily achievable by:
isOutsideRange={date => date.isBefore(minDate) || date.isAfter(maxDate)}
I've been using react-dates for a while with this strategy with success.
@fernandofleury you'd still be able to navigate through all those unavailable months.
@danielzlotnik that is true. but personally, I don't see that as a big UI concern. but it might be different for your case
just to add to @fernandofleury, passing 'day' as the second argument will prevent the current day from falling outside of the range after the initial render
isOutsideRange={date => date.isBefore(minDate, 'day') || date.isAfter(maxDate, 'day')}
Most helpful comment
@fernandofleury you'd still be able to navigate through all those unavailable months.