Repository navigation
Conversation
Co-authored-by: Roji Philip <rojiphil@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
🤖 Android test steps verification results: ❌ fail The CSV upload, column mapping, and import all work on Android, but all 5 two-digit-year dates still import with years 0011, 0024, or 0025, so the fix doesn't take effect on Android at commit 072b700. A likely cause, not yet confirmed: Hermes's
|
|
@rojiphil mind giving us an ETA on when this will be ready for review? |
Will be ready for review today |
|
@MelvinBot Tidy the tests/QA sections with the following test steps. Test 1
Test 2
Test 3
|
|
I replaced the Tests and QA sections with your test steps. I didn't change anything else in the PR body.
I made these small edits:
|
|
@MelvinBot The Android hybrid runs Hermes.
Please evaluate the following suggested fix, which does not use
What do you think? |
|
I agree. The bug is real, and your suggested fix is the right approach. With your go-ahead, I'll update this PR to use it. The bug is real. Hermes All four points hold up:
Implementation notes
Reply with |
|
@MelvinBot Implement this |
… V8 agree Hermes rejects strings such as 01/20/24 in new Date(), so the yyyy formats read them as the year 24 on native. Try yy formats first, reject yyyy matches below the year 1000, keep the format loop ahead of new Date(), and also try the text before the first space for values with a time suffix. Co-authored-by: Roji Philip <rojiphil@users.noreply.github.com>
|
I pushed the change in bf63464. Two-digit years now parse through
I also updated the PR description and removed the Tests
|
|
@MelvinBot Please resolve conflicts |
|
I didn't resolve the conflicts. [Payment due @DylanDylann] Parse two-digit CSV years in the current century and reject years before 1900 was merged yesterday. It rewrote the same functions in
How do you want to proceed?
|
|
@MelvinBot Close this PR as this is already addressed. |
|
I closed this PR. [Payment due |





Explanation of Change
CSV and spreadsheet imports saved two-digit-year dates with the wrong year. For example,
01/20/24became0024-01-20, and11-02-25became0011-02-25. This regression came from #100612, which moved thedate-fnsformat loop ahead ofnew Date()inparseCSVDate. Thedate-fnsyyyytoken matches one to four digits, so it reads24as year 24.Putting
new Date()back in front isn't enough. On native, Hermes'snew Date()rejects strings such as01/20/24, so they would still reach theyyyyformats. Instead, this PR keeps thedate-fnsformat loop ahead ofnew Date(), so web and native give the same result:yyformats (MM/dd/yy,dd/MM/yy,MM-dd-yy,dd-MM-yy,MMM d, yy,MMMM d, yy,d MMM yy) are tried before anyyyyyformat.yyreads at most two digits and maps them into the 100 years around today, so01/20/24and20/01/24both become2024-01-20.01/20/2024doesn't match ayyformat, so it falls through toMM/dd/yyyy.yyyymatch with a year below 1000 is skipped, so a short year can't be saved as a date in the first millennium.yyyy-MM-ddvalue is built in local time byparseISODateOnlybefore the format loop. This keeps the time zone fix from Fix: CSV import shifts ISO date transactions one day earlier for users behind UTC #99583. It also keeps the month (01–12) and day (01–31) ranges ofnew Date(), so2026-02-30still rolls over to2026-03-02, and2026-13-01and2026-01-00are still rejected.new Date().2024-01-15 posted) and then the text before the first space (for example01/20/24 10:30).Unit tests cover two-digit years, a stubbed
Datethat rejects strings the way Hermes does, ISO rollover and rejection, and the fallbacks.Fixed Issues
$ #102517
PROPOSAL: #102517 (comment)
Tests
Test 1: Two-digit year
01/20/24(sample: csv-2digit-year.csv).01/20/24shows as 2024-01-20, not 0024-01-20.Test 2: ISO date in a time zone behind UTC
2026-07-15(sample: csv-iso-date-repro.csv).Test 3: Excel date cells
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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