-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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: "previous month" button appears when selecting a date #5214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ This pull request was sent to the PullRequest network for review. Expert reviewers are now being matched to your request based on the code's requirements. Stay tuned!
What to expect from this code review:
- Comments posted to any areas of potential concern or improvement.
- Detailed feedback or actions needed to resolve issues that are found.
- Turnaround times vary, but we aim to be swift.
@OlegDev1 you can click here to see the review status or cancel the code review job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PullRequest Breakdown
Reviewable lines of change
+ 38
- 1
74% TSX (tests)
26% TSX
Type of change
Fix - These changes are likely to be fixing a bug or issue.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5214 +/- ##
=======================================
Coverage 96.88% 96.89%
=======================================
Files 29 29
Lines 3375 3381 +6
Branches 1409 1418 +9
=======================================
+ Hits 3270 3276 +6
+ Misses 105 103 -2
- Partials 0 2 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No merge blocking issues found. I would suggest to test that the button also re-appears if/when appropriate. Other than that, changes look fine. Thanks for the PR.
Reviewed with ❤️ by PullRequest
Thank you very much for the review, I really appreciate it! I have added an additional button check in the test case as Frank suggested. I also replaced the non-null assertion with an error check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
Linked issue: #5193
Problem
Even though the min date is provided, when selecting the second month, "previous month" button still appears. It shouldn't happen, because the calendar from the screenshots starts at November.
Changes
Changed the calculation logic that determines whether previous month button should appear or not (borrowed some code from
renderMonths
, big thanks to @pmacmillan). Added a test case, in which a calendar is rendered with min date, after that the date from the second month is selected and it is expected for "previous month" button not to appear.Screenshots
Calendar starts at November 7
Before
After
Contribution checklist