You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reports- In Custom date range, "To" option is disabled #87017
Version Number: v9.3.52-0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#85313 Email or phone of affected tester (no customers):testpayment935@gmail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11 pro /Chrome App Component: Chat Report View
Action Performed:
Navigate to staging.new.expensify.com
Go to reports page > Date > Custom range
3 .For From calendar - Choose year 2027 and April 1
For To calendar - Choose year 2027 and April 2
Click Apply
Go to date > Custom range again
Try to change year in To calendar
Expected Result:
To calendar can change year at anytime.
Actual Result:
Unable to change year after applying and going back to change.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
The "To" calendar's year picker becomes disabled because CONST.CALENDAR_PICKER.MAX_DATE is defined as current date + 1 year (~April 2027). When the user selects a "From" date in 2027, the "To" calendar receives minDate = fromDate (2027) and maxDate = MAX_DATE (also 2027). The year list is built from minYear to maxYear at CalendarPicker/index.tsx:81-91, producing only [2027]. The year picker button is disabled when years.length <= 1 at line 205.
The constraint comes from RangeDatePicker.tsx:48: toMinDate = parseCalendarDate(fromValue), which is passed as minDate to the "To" CalendarPicker.
What changes do you think we should make in order to solve the problem?
In RangeDatePicker.tsx, stop passing toMinDate as minDate to the "To" CalendarPicker. Instead, keep CONST.CALENDAR_PICKER.MIN_DATE as the minDate for both calendars, so the year picker always has the full year range available. The date ordering validation (from ≤ to) should be handled at the form/apply level rather than by constraining the calendar navigation itself. This matches how fromMaxDate could similarly over-constrain the "From" calendar.
Alternatively, if the constraint is intentional, the MAX_DATE constant could be extended (e.g., +2 years instead of +1) so there's always room for multiple years, but this is a workaround rather than a proper fix.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
It looks like this only happens for dates in the next year, so I don't think it needs to be a blocker for this new feature. We should fix it though.
I guess we need to decide how the UX works for it, but I kind of think we should allow the user to pick any calendar date on both of the calendars. If from is greater than to, when they go to apply it, we should show an error and force the user to fix it.
Or we need to make the min date for "To" update as soon as it's set for "From", not only once the range is applied.
I think this is not an issue, as fromDate is already selected of year 2027 - we are setting that date as minDate for the To field. With that, the min year needs to be 2027 only so that looks intentional to me.
Yeah, I guess that's a good point. The user should probably realize that they need to reduce the from date. However, it doesn't feel super clear to me, so that's kind of why I suggested this.
allow the user to pick any calendar date on both of the calendars. If from is greater than to, when they go to apply it, we should show an error and force the user to fix it.
That being said, I see that we do tend to disable "To" dates less than "From" when it's set. However, we have kind of an inconsistent experience where if you don't have a date range set at all, then when you set the "From" date, it does not immediately update the minimum date for the "To" value. We should fix that.
I will start a discussion about this internally and come back with clear, expected results for the user experience.
we have kind of an inconsistent experience where if you don't have a date range set at all, then when you set the "From" date, it does not immediately update the minimum date for the "To" value.
Oh, never mind. That's not correct. It does correctly prevent setting the "To" date to anything less than the "From" date. I just didn't notice it at first. So yes, I think this is all good and we can just close the issue. It's not a problem.
Activity
melvin-bot commentedon Apr 2, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #85313
melvin-bot commentedon Apr 2, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 2, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
MelvinBot commentedon Apr 2, 2026
Proposal
What is the root cause of that problem?
The "To" calendar's year picker becomes disabled because
CONST.CALENDAR_PICKER.MAX_DATEis defined ascurrent date + 1 year(~April 2027). When the user selects a "From" date in 2027, the "To" calendar receivesminDate = fromDate(2027) andmaxDate = MAX_DATE(also 2027). The year list is built fromminYeartomaxYearatCalendarPicker/index.tsx:81-91, producing only[2027]. The year picker button is disabled whenyears.length <= 1at line 205.The constraint comes from
RangeDatePicker.tsx:48:toMinDate = parseCalendarDate(fromValue), which is passed asminDateto the "To" CalendarPicker.What changes do you think we should make in order to solve the problem?
In
RangeDatePicker.tsx, stop passingtoMinDateasminDateto the "To" CalendarPicker. Instead, keepCONST.CALENDAR_PICKER.MIN_DATEas the minDate for both calendars, so the year picker always has the full year range available. The date ordering validation (from ≤ to) should be handled at the form/apply level rather than by constraining the calendar navigation itself. This matches howfromMaxDatecould similarly over-constrain the "From" calendar.Alternatively, if the constraint is intentional, the
MAX_DATEconstant could be extended (e.g., +2 years instead of +1) so there's always room for multiple years, but this is a workaround rather than a proper fix.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.neil-marcellini commentedon Apr 2, 2026
It looks like this only happens for dates in the next year, so I don't think it needs to be a blocker for this new feature. We should fix it though.
I guess we need to decide how the UX works for it, but I kind of think we should allow the user to pick any calendar date on both of the calendars. If from is greater than to, when they go to apply it, we should show an error and force the user to fix it.
Or we need to make the min date for "To" update as soon as it's set for "From", not only once the range is applied.
@btkcodedev can you please work on a solution?
2026-04-02_14-43-21.mp4
btkcodedev commentedon Apr 3, 2026
@neil-marcellini
i am working on the solution
Pujan92 commentedon Apr 13, 2026
I think this is not an issue, as fromDate is already selected of year 2027 - we are setting that date as minDate for the To field. With that, the min year needs to be 2027 only so that looks intentional to me.
neil-marcellini commentedon Apr 15, 2026
Yeah, I guess that's a good point. The user should probably realize that they need to reduce the from date. However, it doesn't feel super clear to me, so that's kind of why I suggested this.
That being said, I see that we do tend to disable "To" dates less than "From" when it's set. However, we have kind of an inconsistent experience where if you don't have a date range set at all, then when you set the "From" date, it does not immediately update the minimum date for the "To" value. We should fix that.
I will start a discussion about this internally and come back with clear, expected results for the user experience.
neil-marcellini commentedon Apr 15, 2026
Oh, never mind. That's not correct. It does correctly prevent setting the "To" date to anything less than the "From" date. I just didn't notice it at first. So yes, I think this is all good and we can just close the issue. It's not a problem.
2026-04-15_13-46-47.mp4