Skip to content
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: Year selection ignores maxDate #3488

Closed
flashcrow2000 opened this issue Oct 20, 2022 · 3 comments · Fixed by #3490
Closed

Calendar: Year selection ignores maxDate #3488

flashcrow2000 opened this issue Oct 20, 2022 · 3 comments · Fixed by #3490
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@flashcrow2000
Copy link
Contributor

Describe the bug

Add a maxDate prop to a Calendar component. You won't be able to select days or months bigger than the current one, but you can select years in the future just fine. Also, selecting a year in the future will display a month selection screen with all months disabled (expected)

Reproducer
https://codesandbox.io/s/beautiful-leftpad-j73ru6

PrimeReact version
8.6.1

React version
17.x

Language
ALL

Build / Runtime
Any

Browser(s)
Any

Steps to reproduce the behavior

  • add maxDate={new Date()} as a prop to a Calendar component
  • click the year selector when picking a new date
  • select a year in the future

Expected behavior
Years in the future should be disabled, same as with the month selector screen

Actual behavior
Years in the future can be selected, but months are disabled, so the user has to go back and select another year, or click on < until they reach the current year.

@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 20, 2022
@melloware melloware changed the title Year selection ignores maxDate Calendar: Year selection ignores maxDate Oct 20, 2022
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 20, 2022
@melloware melloware added this to the 8.6.2 milestone Oct 20, 2022
@melloware
Copy link
Member

Thank you for the report and the fix!

@flashcrow2000
Copy link
Contributor Author

my pleasure!

@melloware
Copy link
Member

Looks like it works for maxDate but not minDate: #3967

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants