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

Incorrect year display in Calendar after navigating to next year #5533

Closed
vnedevaa opened this issue Dec 6, 2023 · 1 comment · Fixed by #5539
Closed

Incorrect year display in Calendar after navigating to next year #5533

vnedevaa opened this issue Dec 6, 2023 · 1 comment · Fixed by #5539
Assignees
Labels
Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@vnedevaa
Copy link

vnedevaa commented Dec 6, 2023

Describe the bug

I am using PrimeReact version 10.1.1 and have implemented the Calendar component. I have configured the calendar to open at the current date. However, the current behaviour differs from the default PrimeReact behaviour, which typically renders the state it was in before.

Steps to Reproduce:

  1. Open the calendar.
  2. Navigate through the months and go to the next year.
  3. Close the calendar.
  4. Open the calendar again.

Expected Behaviour:
Upon reopening the calendar, I expect to see the current month and the current year.

Actual Behavior:
However, what I observe is that the calendar displays the previous year, but with the correct dates for the current month of the current year.

Screenshot 2023-12-05 at 16 54 53 Screenshot 2023-12-05 at 16 55 09

Reproducer

https://codesandbox.io/p/sandbox/primereact-demo-forked-ygt9ly?file=%2Fsrc%2FApp.js

PrimeReact version

10.1.1

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. Open the calendar.
  2. Navigate through the months and go to the next year.
  3. Close the calendar.
  4. Open the calendar again.

Expected behavior

Upon reopening the calendar, I expect to see the current month and the current year.

@vnedevaa vnedevaa added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 6, 2023
@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 Dec 6, 2023
@melloware
Copy link
Member

Fixed your sandbox: https://codesandbox.io/p/sandbox/primereact-demo-forked-44vqcv?file=%2Fsrc%2FApp.js%3A30%2C16

You had too many hooks firing setting setDate().

Duplicate of #4147

@melloware melloware added the Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team label Dec 6, 2023
melloware added a commit to melloware/primereact that referenced this issue Dec 6, 2023
@melloware melloware self-assigned this Dec 6, 2023
@melloware melloware added this to the 10.2.2 milestone Dec 6, 2023
melloware added a commit to melloware/primereact that referenced this issue Jan 9, 2024
melloware added a commit that referenced this issue Jan 9, 2024
* Fix #5349: PanelMenu fix from PrimeVue

* Fix #5360: Cascade select popup not closing on escape

* fix: #5363, Mention: Page Breaks when navigating to Mention component

* fix: #5365 SplitButton popup not closing on escape button click

* Fix #5367: SpeedDial close on escape

* Fix #2666: Fix overlay components in cell editor

* Fix #5363: Mention better fix

* Fix #5379: Accordion tab header passthrough errors
Fix #5546: AccordionTab Tailwind issues

* Fix #5385: Password inputClassname missing

* Fix #5390: Calendar only render navigator in first month of multiple months

* Fix #5202: Calendar rendering performance increase

* Fix #5535: Calendar update input on locale change

* Fix #5533/#4147: Calendar respect viewDate

* Fix Calendar Input Docs

* fix:Calendar:currentView changed should invoke alignOverlay

* Fix #5379: Accordion tab header passthrough errors
Fix #5546: AccordionTab Tailwind issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team 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