Repository navigation
Limit calendar year and month navigation to minDate and maxDate - #103246
Conversation
Fixed-range date pickers such as date of birth and incorporation date now list only the years between minDate and maxDate, and the arrows and month list stop at those limits. Search date pickers keep free navigation and limit selectable days through a new isDateSelectable rule. Adds DateUtils.parseCalendarDate and DateUtils.isWithinCalendarPickerRange. Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
🤖 Web test steps verification results: ❌ fail The test browser couldn't sign in to the dev web app, so none of the calendar picker steps ran. The sign-in "Continue" button did nothing: the screen didn't change and no sign-in request was sent. This is a test environment problem, not a sign of a bug in this PR. The PR's Tests section is still empty, so I planned to run the issue's reproduction steps and the expected results from the PR description, plus one Search date filter regression check.
|
|
@MelvinBot Please merge main |
Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
|
I merged The merge had no conflicts. |
|
@MelvinBot please make the PR ready for review |
|
I marked this PR as ready for review. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@MelvinBot Please address the above bot comments and mark them as resolved after resolving |
…tences Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid-Native.mp4Android: mWeb ChromeAndroid-mWeb.mp4iOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMac-Chrome.mp4 |
|
I replaced the steps in the Two notes:
|
|
@MelvinBot Please make two changes to the PR description: Changes:1. Under "Year lists before and after, as of October 2026:", add this table:
Years assume testing in 2026 (add 1 in 2027). "Greyed out" means shown but can't be picked. |
|
I updated the PR description with both changes:
I left the rest of the description unchanged. |
|
cc @joekaufmanexpensify for product |
|
Is there a specific reason to stop expense picker, expensify card start/end date, and report field date at 2027? Not necessarily opposed to that, but would like to understand more about where the logic came from |
|
This PR doesn't add those limits. They were already there: the expense date, report field date and Expensify Card date pickers all pass
|
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
|
All yours @luacmartins |
|
Please resolve conflicts and merge main. |
Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
|
I merged The only conflict was in
|
|
Please merge main |
Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
|
I merged the latest The merge had no conflicts. None of the files changed on |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.5.9-0 🚀
|
|
No help site update needed. This PR limits the calendar's year list and arrows to the dates each field already allows, and no article in |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.9-4 🚀
Bundle Size Analysis (Sentry): |









Explanation of Change
The calendar built its year list from a fixed range, the current year ±100 (1926 to 2126), and ignored each picker's
minDateandmaxDate. The month and year arrows used the same range, so only the days followed the limits. As a result, date of birth listed years up to 2126 but couldn't reach birth years before 1926, and incorporation date listed years far in the future.Now
minDateandmaxDatelimit the whole calendar:minDateto the year ofmaxDate.minDateandmaxDate.Search date pickers keep free navigation from 1926 to 2126, as #87452 needs: in the custom range, each calendar's limit is the date picked in the other one. They limit only which days can be picked, through a new
isDateSelectableprop. Schedule a call now uses that prop too, in place ofselectableDates.Also in this PR:
CalendarPickernow takes and returnsDatevalues. Callers read stored dates with the newDateUtils.parseCalendarDate, which replaces the copies inRangeDatePickerandChronosUtils, and still save them asyyyy-MM-dd.Year lists before and after, as of October 2026:
Fixed Issues
$ #102227
PROPOSAL: #102227 (comment)
Tests
Years assume testing in 2026 (add 1 in 2027). "Greyed out" means shown but can't be picked.
Test 1: Date of birth (use an account with no date of birth saved)
Test 2: Expense date
Test 3: Custom status date
Test 4: Search single date
Test 5: Search custom range
Test 6: Keyboard (web, desktop width)
Test 7: Empty scanned date
Test 8: Incorporation date (needs a USD workspace)
Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android-Native.mp4
Android: mWeb Chrome
Android-mWeb.mp4
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari