Repository navigation
Localize abbreviated month and day dates - #105866
Conversation
Add DateUtils.formatToMonthDay, backed by a cached Intl.DateTimeFormat, and formatToMonthDayWithOptionalYearInUTC, which keeps the past-year rule and reads calendar dates as UTC. Search rows, transaction previews, recently added expenses, split rows, the card authorization preview, calendar times this week and the reusable route Last used date now use them, so other languages get their own month-day order. English output is unchanged.
formatToMonthDayWithOptionalYearInUTC shows the date in UTC, so read the date's year in UTC too before comparing it with the device's current year. Reading it in the device's timezone added a year to January 1 dates behind UTC. Add the DateCell, Last used and reused-route badge tests from Expensify#105846.
A cached Intl.DateTimeFormat keeps the device timezone from when it was created. Format local dates in UTC and copy their current local fields instead. Dates formatted in an explicit timezone are unchanged.
|
@linhvovan29546 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
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. |
…h-day # Conflicts: # tests/unit/DateUtilsTest.ts
dylanexpensify
left a comment
There was a problem hiding this comment.
Looks good from a product perspective 👍
|
Conflicts |
…calize-dates-month-day # Conflicts: # tests/unit/DateUtilsTest.ts
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: mWeb Safari |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 roryabraham 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/roryabraham in version: 9.5.36-0 🚀
|
|
No FullStory changes needed — this PR only fixes localized date formatting and UTC year handling in existing UI, without adding new user interactions, screens, or sensitive content. |
|
No help site update needed — this PR fixes date formatting to follow the selected language’s conventions, restoring expected behavior without adding a workflow or making existing article instructions incorrect. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.36-0 🚀
Bundle Size Analysis (Sentry): |






Explanation of Change
Short dates without a year were built from the hand-written date-fns pattern
MMM d. The pattern fixes the US order, so other languages showed their own month name in an English shape, for exampleJuni 20in German and6月 20in Japanese.date-fns has no localized token for a month and day without a year, so this adds
DateUtils.formatToMonthDay, which uses a cachedIntl.DateTimeFormatwith the app's selected language.DateUtils.formatToMonthDayWithOptionalYearInUTCkeeps the existing rule of adding the year only for dates outside the current year, and keeps reading calendar dates as UTC so the day never shifts.Places updated:
Jun 20 at 2:05 PM)The year branch still uses
CONST.DATE.MONTH_DAY_YEAR_ABBR_FORMAT, which is localized separately.CONST.DATE.MONTH_DAY_ABBR_FORMATis left in place for now so this PR does not conflict with the other date PRs that edit neighbouring constants; a follow-up removes the unused constants.This is one of a set of small, independent PRs that split up the date-localization work in #105846. They can merge in any order. Each one caches its own
Intl.DateTimeFormatnext to the function it changes; a follow-up will merge those into one shared helper.Update: year rule reads the date in UTC
formatToMonthDayWithOptionalYearInUTCnow reads the stored date's year in UTC, the timezone it is shown in, and compares it with the device's current year. It useddoesDateBelongToAPastYear, which read the stored date in the device's timezone, so on a device behind UTC a January 1 date fell on December 31 and was shown with a year. Themonth and daytests intests/unit/DateUtilsTest.tscover it; the case fails with the old rule underTZ=America/Los_Angeles. This update also ports theDateCell, Last used and reused-route badge tests from #105846.Fixed Issues
$ #98088
PROPOSAL:
Tests
20. Juni.20. Juni.20. Juni.Jun 20, the same as before.Offline tests
Same as tests.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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
Screen.Recording.2026-11-06.at.8.21.31.PM.mov