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: Can't pick year if use minDate and maxDate with lass then one year #4537

Closed
dymytrii-tretiakov opened this issue Jun 22, 2023 · 1 comment
Labels
Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted
Milestone

Comments

@dymytrii-tretiakov
Copy link

Describe the bug

I use minDate and maxDate props in the Calender component, but we have a range less them year, and if we click to a year in Calendar top bar the current year is disabled

Step to reproduce:

  1. Add to Calendar props minDate, maxDate, for example
    <Calendar value={date} onChange={(e) => setDate(e.value)} minDate={new Date("06.01.2023")} maxDate={new Date("06.30.2023")} />
  2. Click to input and click to year in top bar
  3. 2023 year is disabled

Demo:
https://codesandbox.io/s/primereact-demo-forked-m7pgjw?file=/src/App.js:243-407

Expected behavior:
After clicking on the year I will see a list of years where 2023 is available to select, after clicking on the 2023 year I will see a list of months where June is available to click

Reproducer

https://codesandbox.io/s/primereact-demo-forked-m7pgjw?file=/src/App.js:243-407

PrimeReact version

9.3.1

React version

17.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

All

Steps to reproduce the behavior

  1. Add to Calendar props minDate, maxDate, for example
    <Calendar value={date} onChange={(e) => setDate(e.value)} minDate={new Date("06.01.2023")} maxDate={new Date("06.30.2023")} />
  2. Click to input and click to year in top bar
  3. 2023 year is disabled

Expected behavior

After clicking on the year I will see a list of years where 2023 is available to select, after clicking on the 2023 year I will see a list of months where June is available to click

@dymytrii-tretiakov dymytrii-tretiakov added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 22, 2023
@melloware melloware added Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 22, 2023
@melloware melloware added this to the 9.6.0 milestone Jun 22, 2023
@melloware
Copy link
Member

Already fixed in upcoming 9.6.0. This was reported in this ticket: #4456

I just tested your scenario and its working in 9.6.0

image

@melloware melloware closed this as not planned Won't fix, can't repro, duplicate, stale Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted
Projects
None yet
Development

No branches or pull requests

2 participants