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

Fix #6737 Calendar month navigator #6739

Merged

Conversation

KirilCycle
Copy link
Contributor

@KirilCycle KirilCycle commented Jun 7, 2024

Defect Fixes

Fix #6737 Ensure the day of the date is reset before updating the calendar. The 'navBackward' and 'navForward' methods reset the date to the first day to prevent this bug. If the line 'newViewDate.setDate(1)' is removed, the same error observed with the options will occur.

Copy link

vercel bot commented Jun 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Jun 7, 2024 6:43pm
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Jun 7, 2024 6:43pm

Copy link

github-actions bot commented Jun 7, 2024

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

@@ -480,6 +480,7 @@ export const Calendar = React.memo(
const currentViewDate = getViewDate();
let newViewDate = cloneDate(currentViewDate);
Copy link
Contributor Author

@KirilCycle KirilCycle Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can i simply use new Date(), as in previous commit ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this looks good if you look down in the calendar you will see we do this...

currentDate.setDate(1); // #2948 always set to 1st of month

So clearly this spot was missed.

@KirilCycle KirilCycle changed the title Fix/calendar month navigator Fix #6737 Calendar month navigator Jun 7, 2024
@KirilCycle KirilCycle marked this pull request as ready for review June 7, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Month skipped in dropdown when last day of month is greater than last day of next month
2 participants