Skip to content

Conversation

@catamorphism
Copy link
Contributor

See #3159

@catamorphism
Copy link
Contributor Author

test262 PR: tc39/test262#4636

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.67%. Comparing base (1962c8b) to head (dcf62ff).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3176      +/-   ##
==========================================
+ Coverage   96.66%   96.67%   +0.01%     
==========================================
  Files          22       22              
  Lines       10321    10357      +36     
  Branches     1857     1859       +2     
==========================================
+ Hits         9977    10013      +36     
  Misses        294      294              
  Partials       50       50              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this fixes some cases but regresses others.

d1 = new Temporal.PlainDate(2016, 3, 31, 'chinese');
d2 = new Temporal.PlainDate(2019, 3, 29, 'chinese');
d1.until(d2, { largestUnit: 'years' })
  // old: P3Y
  // new: P37M
  // The old result is dubious (looks like it might need to be P3Y1M) but the new result seems wrong in any case

d1 = new Temporal.PlainDate(2019, 5, 1, 'chinese');
d2 = new Temporal.PlainDate(2020, 4, 19, 'chinese');
d1.until(d2, { largestUnit: 'years' })
  // old: P1Y
  // new: P12M
  // The old result seems correct (Chinese year 2019 is a common year)

I suspect this is because the assumption mentioned in the comment is incorrect: that the difference is less than a year when we hit the problematic case.

I've pushed the in-progress snapshots I've been working with to https://github.com/tc39/proposal-temporal/compare/chinese-hebrew-snapshots?expand=1 so you can do the same testing I'm doing.

@catamorphism catamorphism marked this pull request as draft November 11, 2025 02:01
@catamorphism catamorphism marked this pull request as ready for review November 11, 2025 22:02
Copy link
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct to me. I have just a couple of nitpicks.

}
const diffYears = calendarTwo.year - calendarOne.year;
// Take the difference between the years of the two dates
let diffYears = calendarTwo.year - calendarOne.year;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Copy link
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ptomato ptomato merged commit 4197642 into tc39:main Nov 21, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants