Skip to content

[Due for payment 2026-01-29] Date - Wrong date (moved back by one day) displayed in date field #80024

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.5-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: Exploratory around #78251
Email or phone of affected tester (no customers): kiatest.78+ck118261@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Windows 11/Chrome, iPhone 16/iOS 18.7.1
App Component: User Settings

Action Performed:

Precondition: User is located in US & current date is 01/20/2026

  1. Navigate to staging.new.expensify.com
  2. Go to Profile >> Status >> Under Clear after, select Custom.
  3. Open the Date picker.
  4. Select a different date
  5. Observe date in date field is moved back by one day
  6. Scroll down to Private section >> Date of birth field
  7. Select any year/date
  8. Observe date in date field is moved back by one day
  9. Save it & observe incorrect date get saved
  10. Repeat steps in Company cards page assigning card to user
  11. Select transaction start date & observe incorrect date get displayed in date field

Expected Result:

Same date selected in date picker should reflect in date field. Date should not be moved back by one day in date field

Actual Result:

Wrong date (moved back by one day) displayed in date field

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7054269_1768936948671.505.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @garrettmknight

Activity

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

    @melvin-bot

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

  3. melvin-bot commented on Jan 20, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jan 20, 2026

    @melvin-bot

    Triggered auto assignment to @garrettmknight (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  5. github-actions commented on Jan 20, 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.
  6. lanitochka17 commented on Jan 20, 2026

    @lanitochka17
    Author

    Production:

    Recording.4767.mp4
  7. OSBotify commented on Jan 20, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #78251 - "Fix localization: dates not being localized correctly" by @sofi-a (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #78251 introduced a timezone conversion bug in the CalendarPicker component. The code attempts to "avoid timezone issues" by converting dates to UTC, but this actually CAUSES the reported issue where selected dates are moved back by one day.

    Labels: No label changes needed - keeping DeployBlockerCash as this is a frontend bug affecting the App deploy.

    📋 Detailed Analysis

    Evidence

    • Bug is reproducible only in staging (v9.3.5-0), not in production
    • Issue was discovered during exploratory testing around PR Fix localization: dates not being localized correctly  #78251
    • Bug affects multiple date pickers: Status clear date, Date of birth, Company card transaction dates
    • Affects users in timezones west of UTC (confirmed with Windows/Chrome and iOS devices)

    Verification

    The bug is in src/components/DatePicker/CalendarPicker/index.tsx lines 108-111:

    const onDayPressed = (day: number) => {
        setCurrentDateView((prev) => {
            // convert to UTC to avoid timezone issues
            const date = new Date(Date.UTC(prev.getFullYear(), prev.getMonth(), prev.getDate()));
            const newCurrentDateView = setDate(date, day);
            onSelected?.(format(new Date(newCurrentDateView), CONST.DATE.FNS_FORMAT_STRING));
            return newCurrentDateView;
        });
    };

    PR #78251 modified this file and introduced the UTC conversion code (lines 108-109).

    Root Cause

    The code creates a UTC timestamp, then formats it back to local time:

    1. User selects January 20, 2026
    2. Code creates UTC date: Date.UTC(2026, 0, 20) → 2026-01-20 00:00:00 UTC
    3. For users in PST (UTC-8), this UTC timestamp represents 2026-01-19 16:00:00 PST
    4. When format() converts to local time for display, it shows 2026-01-19

    The "convert to UTC to avoid timezone issues" comment is ironic - this conversion IS the timezone issue. Dates should remain in local time throughout the selection process.

    Impact

    This affects all date picker usage across the app for users in western timezones (Americas, parts of Pacific). The selected date is consistently off by one day, causing:

    • Wrong status clear dates
    • Incorrect date of birth values saved to user profiles
    • Wrong transaction start dates for company cards
  8. iwiznia commented on Jan 20, 2026

    @iwiznia
    Contributor

    Alright, this is the 3rd issue with that PR. I think I am reverting the PR...

  9. 2 remaining items

  10. iwiznia commented on Jan 21, 2026

    @iwiznia
    Contributor

    What's merp revert??

  11. situchan commented on Jan 21, 2026

    @situchan
    Contributor

    I can help with manual revert if needed.

  12. Beamanator commented on Jan 21, 2026

    @Beamanator
    Contributor

    Merp = "shucks". Revert = "revert" 🤣

  13. Beamanator commented on Jan 21, 2026

    @Beamanator
    Contributor

    fixed in staging 👍

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jan 22, 2026
  15. changed the title [-]Date - Wrong date (moved back by one day) displayed in date field[/-] [+][Due for payment 2026-01-29] Date - Wrong date (moved back by one day) displayed in date field[/+] on Jan 22, 2026
  16. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  17. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.6-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-01-29. 🎊

  18. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    @iwiznia @garrettmknight The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions