Skip to content

Fix Temporal calendar handling and enable 2,782 more test262 passes#2347

Merged
lahma merged 1 commit into
sebastienros:mainfrom
lahma:more-intl
Mar 22, 2026
Merged

Fix Temporal calendar handling and enable 2,782 more test262 passes#2347
lahma merged 1 commit into
sebastienros:mainfrom
lahma:more-intl

Conversation

@lahma

@lahma lahma commented Mar 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix with() for Gregorian-based calendars (buddhist/roc/japanese) in PlainDateTime, ZonedDateTime, PlainYearMonth — route through CalendarDateToISO instead of treating calendar year as ISO year
  • Fix dayOfYear for non-ISO calendars — return calendar-aware day-of-year instead of ISO day-of-year
  • Reject islamic/islamic-rgsa calendars in Temporal from() constructors (observation-based, not supported for arithmetic)
  • Add missing era/eraYear field reading in ZonedDateTime.prototype.with()
  • Fix month/monthCode priority in non-ISO with() — when monthCode is explicitly provided but month is not, avoid conflict with defaulted month value
  • Fix single-era calendars (coptic, hebrew, persian, indian, ethioaa) to always return primary era regardless of year sign
  • Accept ad/bc as era code aliases for ce/bce in Japanese calendar
  • Fix Japanese Meiji era offset (eraYear + 1867), display boundary (year >= 1873), and year-level boundary (no day-level check for Meiji)
  • Fix invalid monthCode rejection (M14 for 13-month calendars, M13 for 12-month calendars)
  • Consolidate duplicated monthCode validation into ValidateMonthCodeForNonLeapCalendar helper

Before: 93,206 test262 passes, ~343 excluded intl402/Temporal files
After: 95,988 test262 passes, 215 excluded intl402/Temporal files (+2,782 passes, 128 fewer exclusions)

Test plan

  • dotnet test --configuration Release Jint.Tests.Test262/Jint.Tests.Test262.csproj — 95,988 passed, 0 failed
  • dotnet test --configuration Release Jint.Tests/Jint.Tests.csproj — 2,764 passed, 0 failed
  • No regressions in existing tests

🤖 Generated with Claude Code

…jection (+2,782 test262 passes)

- Route buddhist/roc/japanese through CalendarDateToISO in PlainDateTime/ZonedDateTime/PlainYearMonth with()
- Add CalendarDayOfYear helper for non-ISO calendar day-of-year computation
- Reject islamic/islamic-rgsa calendars in Temporal from() constructors (observation-based)
- Add missing era/eraYear field reading in ZonedDateTime.prototype.with()
- Fix month/monthCode priority in non-ISO with() (pass month=0 when monthCode explicit)
- Fix single-era calendars (coptic, hebrew, persian, indian, ethioaa) to always return primary era
- Accept "ad"/"bc" as era code aliases for "ce"/"bce" in Japanese calendar
- Fix Japanese Meiji era: ComputeYearFromEra offset (1867), display boundary (year >= 1873)
- Fix invalid monthCode rejection (M14 for coptic, M13 for 12-month calendars)
- Consolidate monthCode validation into ValidateMonthCodeForNonLeapCalendar helper

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lahma
lahma enabled auto-merge (squash) March 22, 2026 14:46
@lahma
lahma disabled auto-merge March 22, 2026 14:52
@lahma
lahma enabled auto-merge (squash) March 22, 2026 14:52
@lahma
lahma merged commit 5e8f6f3 into sebastienros:main Mar 22, 2026
4 checks passed
@lahma
lahma deleted the more-intl branch March 22, 2026 14:58
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.

1 participant