Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

Fix #8052 year not updated with viewDate changes#8134

Closed
ulgyd0gg wants to merge 3 commits into
primefaces:masterfrom
ulgyd0gg:master
Closed

Fix #8052 year not updated with viewDate changes#8134
ulgyd0gg wants to merge 3 commits into
primefaces:masterfrom
ulgyd0gg:master

Conversation

@ulgyd0gg

Copy link
Copy Markdown
Contributor

Fix #8052
The issue occurred when we set the view date and deleted the input field. The currentYear variable retained the old value (in this case, 2000).

const viewDate = getViewDate();
const viewYear = viewDate.getFullYear();
const displayYear = props.numberOfMonths > 1 || props.yearNavigator ? metaYear : currentYear;

I adjusted displayYear to use metaYear, which fixes the issue, and the yearNavigator works correctly. However, if we modify the value of InputRef.current.value in a way that it cannot be parsed as a Date, the rendering will fall back to using ViewDate as the parameter.

@ulgyd0gg

Copy link
Copy Markdown
Contributor Author

I aslo realize viewDate still didn't have doc. should we provide?🤔

@ulgyd0gg

Copy link
Copy Markdown
Contributor Author

I sincerely apologize for including previous commit messages in this PR. As a GitHub beginner, I would greatly appreciate your guidance on how to properly handle this situation. Thank you!

@ulgyd0gg ulgyd0gg closed this Jul 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar: year not updated with viewDate changes

2 participants