-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calendar: shows future and/or past dates even when minDate and/or maxDate props are set #7649
Comments
There is a another property: https://primereact.org/calendar/#api.Calendar.props.showMinMaxRange Some users wanted people to allow you to see older and future invalid dates but the |
Here is a stackblitz: https://stackblitz.com/edit/uvwu3ybx?file=src%2FApp.jsx |
Oh, I had tried this property and it didn't work, so I had assumed it had a different purpose. It works now! Just one little thing, I think the documentation and/or name of the property should be adjusted: "showMinMaxRange: Whether to allow navigation past min/max dates." Because when you set the property to true, the navigation is NOT allowed, contrary to what indicated above Any way, thank you a lot! |
@acc-cassio do you have a recommendation for what the docs should say? I can make the change? |
how about this
|
The suggestion sounds quite clear to me! Thank you! |
Ideally the name of the property should be changed too, right? But I guess this is more complicated due to backwards compatibility? |
I'd name it 'restrictMinMaxNav', to match the suggested description |
yeah i hate renaming props after they exist though and PR uses a lot of |
Describe the bug
The Calendar component shows past and future dates even when minDate and maxDate are set.
Case in point: the "MinMax" example in the documentation. You can go past minDate and maxDate.
Apparently, this issue has been solved before, see issue #1661. However, the behaviour is still present in primereact's current version.
Reproducer
No response
System Information
Steps to reproduce the behavior
Expected behavior
Dates before minDate and after maxDate (whichever is present, if any) should not be shown.
The text was updated successfully, but these errors were encountered: