[pickers] Flag the first and last visible day cell across year boundaries#22981
Merged
LukasTy merged 2 commits intoJun 29, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Author
|
@michelengelen @LukasTy Kindly have a review on this pr. Thanks! |
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
LukasTy
approved these changes
Jun 29, 2026
LukasTy
left a comment
Member
There was a problem hiding this comment.
Your contribution is much appreciated! 🙏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug where the first/last visible cell of the calendar day grid was never flagged when it fell in a different year than the displayed month.
In
DayCalendar,isFirstVisibleCell/isLastVisibleCellcomputed the current-month anchor withadapter.setMonth(day, currentMonthNumber), which keepsday's year. For an outside-month cell in a different year (for example 2023-12-31 as the first cell of a January 2024 grid), the anchor became January 2023, so the genuine first cell was never flagged. The same happened for December grids whose last visible cell falls in the next January.The fix anchors on
currentMonth(already available viaparentProps), which carries the correct year. Behavior is unchanged for months that do not cross a year boundary.These flags feed the
PickerDayisFirstVisibleCell/isLastVisibleCellprops and theMuiDateRangePickerDay-firstVisibleCell/-lastVisibleCellclasses. No built-in style consumes them, so there is no default visual change, but consumer or theme overrides targeting those classes are affected.Closes #22978
Change summary
Fixed the first/last visible cell of the calendar day grid not being flagged at year boundaries.