Skip to content

Reports- In Custom date range, "To" option is disabled #87017

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


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:

  1. Navigate to staging.new.expensify.com
  2. Go to reports page > Date > Custom range
    3 .For From calendar - Choose year 2027 and April 1
  3. For To calendar - Choose year 2027 and April 2
  4. Click Apply
  5. Go to date > Custom range again
  6. 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.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7120189_1775162336475.bandicam_2026-04-02_23-14-49-619.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 2, 2026
  2. melvin-bot commented on Apr 2, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #85313

  3. melvin-bot commented on Apr 2, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Apr 2, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. MelvinBot commented on Apr 2, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    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.

  6. neil-marcellini commented on Apr 2, 2026

    @neil-marcellini
    Contributor

    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
  7. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Apr 2, 2026
  8. btkcodedev commented on Apr 3, 2026

    @btkcodedev
    Contributor

    @neil-marcellini
    i am working on the solution

  9. added
    ReviewingHas a PR in review
    and removed on Apr 3, 2026
  10. Pujan92 commented on Apr 13, 2026

    @Pujan92
    Contributor

    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.

  11. neil-marcellini commented on Apr 15, 2026

    @neil-marcellini
    Contributor

    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.

  12. neil-marcellini commented on Apr 15, 2026

    @neil-marcellini
    Contributor

    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.

    2026-04-15_13-46-47.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions