fix: localization dates not being localized correctly - #91569
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
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.
|
…ation-dates-not-being-localized-correctly # Conflicts: # src/pages/Travel/FlightTripDetails.tsx
PR ReviewWell-executed migration from date-fns format strings to Issues to fix1. Mock type mismatch — 2. 3. Suggestions (non-blocking)4. 5. CalendarPicker missing 6. What's done well
|
|
@TaduJR you're missing native platform tests. Please test various timezones (US timezone UTC-X, Asia timezone UTC+X) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e56f6b81c3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…ation-dates-not-being-localized-correctly # Conflicts: # src/components/FrozenCardHeader.tsx # src/pages/Travel/TrainTripDetails.tsx
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64f6c4cb74
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
…ation-dates-not-being-localized-correctly
Regression huntBottom line: No confirmed regressions. I ran a live web pass + a focused delta check at the current head ( ✅ Verified clean
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4387fb4992
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai. |
…ation-dates-not-being-localized-correctly # Conflicts: # src/pages/iou/request/step/DynamicIOURequestStepDistanceManual.tsx # src/pages/iou/request/step/IOURequestStepAmount.tsx # src/pages/iou/request/step/IOURequestStepDistanceGPS/index.native.tsx
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
Please fix conflict before going off for weekend. Then I'll review during weekend |
…ation-dates-not-being-localized-correctly
…guard with its callers
…ation-dates-not-being-localized-correctly
…te-range formatters
…ation-dates-not-being-localized-correctly # Conflicts: # cspell.json
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
…ation-dates-not-being-localized-correctly # Conflicts: # src/components/ReportActionItem/ChronosOOOListActions.tsx
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c5635e9d1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |




Explanation of Change
Display dates ignored the user's language. A Spanish user saw
ago 19, 2025 a 12:02 PM: the month name was translated, but the order, the separators and the 12-hour clock were still English. Spanish writes19 ago 2025. Translating the words isn't enough field order and clock style are part of the language too, and onlyIntl.DateTimeFormatknows them per locale.Every date a user reads now goes through
Intl.DateTimeFormatusing a named format fromCONST.DATE.INTL_FORMATS, with the locale passed in as an argument rather than read from a global.Dates sent to the API or written to Onyx are untouched and still use
yyyy-MM-dd HH:mm:ss. Those formats now have their own type, so a locale can no longer be passed where a format string belongs that mix-up is what crashed the second attempt.The calendar starts the week on the correct day per locale via
Intl.Locale.getWeekInfo(), with a fallback for Firefox and older Hermes builds that don't expose it.Two things I'd like your call on:
ento en-US, which starts on Sunday. Following that would shift the calendar for every existing English user, so I kept Monday. Easy to change if you'd prefer the CLDR behaviour.@formatjs/intl-relativetimeformat(native only). Hermes doesn't implementIntl.RelativeTimeFormat, so "Last synced 2 hours ago" renders blank on iOS and Android without it. It's the fifth polyfill of this kind already in the repo and it no-ops on web, where the API exists.Fixed Issues
$ #69562
PROPOSAL: #69562 (comment)
Tests
Setup: You will switch languages several times. The language setting is at Settings > Preferences > Language. Switch back to English between sections unless a step says otherwise.
Throughout, a date is only correct if the whole thing matches the reference table below, not just the month name. The bug being fixed is that dates used Spanish/German words in English order.
Reference — a date/time of 19 August 2025, 2:30 PM should read:
Two things that are correct and should not be reported as bugs:
19 ago, not19 Ago). Those languages do not capitalise months.19.08.2025). That is how German writes a medium date.1. Chat message timestamps
Today at 2:30 PM, older onesAug 19, 2025 at 2:30 PM.Hoy a las 14:30and19 ago 2025 a 14:30.Heute um 14:30and19.08.2025 um 14:30.Today atwith no time after it).2. Expense list dates
Aug 19and older ones showAug 19, 2025.19 agoand19 ago 2025.8月19日and2025/08/19.3. Calendar — first day of the week
4. Calendar — month names
Enero, Febrero, Marzo…(capitalised here — this is a standalone list, so capitals are correct).Janvier, Février, Mars…. In German:Januar, Februar, März….5. Date field placeholder
MM/DD/YYYY.DD.MM.YYYY. Japanese:YYYY/MM/DD.6. Selected date must not shift by a day
7. Merging expenses must not crash
8. Split expense on Android
9. "Last synced" text — needs iOS and Android
2 hours ago/3 days ago. It must not be empty.hace 2 horas.Last synced …— confirm it is not blank in both languages.10. Travel and trip dates
- 10:30).Aug 17-20in English and17-20 agoin Spanish — the month must not sit between the two days.11. Search filters
12. Per Diem — including a previously reported save failure
13. Other date surfaces
Confirm dates read in the selected language on:
Offline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Mac-Chrome.mp4