Skip to content

feat(intl): implement Temporal.PlainYearMonth.prototype.toLocaleString#5098

Open
alienx5499 wants to merge 1 commit intoboa-dev:mainfrom
alienx5499:feat/5083-plainyearmonth-tolocalestring
Open

feat(intl): implement Temporal.PlainYearMonth.prototype.toLocaleString#5098
alienx5499 wants to merge 1 commit intoboa-dev:mainfrom
alienx5499:feat/5083-plainyearmonth-tolocalestring

Conversation

@alienx5499
Copy link
Contributor

@alienx5499 alienx5499 commented Mar 15, 2026

This Pull Request fixes/closes #5083.

It changes the following:

  • Implement Temporal.PlainYearMonth.prototype.toLocaleString per spec, using the shared format_date_time_locale pipeline (same pattern as Date.prototype.toLocaleDateString).
  • Add timestamp_for_first_of_month_utc in date/utils.rs to produce a formatting anchor (first day of month at 00:00:00 UTC) for Intl.DateTimeFormat; no extra JS object allocation on the hot path.
  • Add mod tests and tests for PlainYearMonth.prototype.toLocaleString: returns string, invalid receiver throws TypeError, and (with the intl feature) different locales and options affect output.

Testing

  • cargo test -p boa_engine --no-default-features --features temporal --lib plain_year_month (Temporal-only tests)
  • cargo test -p boa_engine --features intl_bundled,temporal --lib plain_year_month (with intl)

Status: rebased onto main after #5080; this PR now only contains the Temporal PlainYearMonth.prototype.toLocaleString changes for #5083.

@github-actions github-actions bot added Waiting On Review Waiting on reviews from the maintainers C-Tests Issues and PRs related to the tests. C-Builtins PRs and Issues related to builtins/intrinsics C-Intl Changes related to the `Intl` implementation and removed Waiting On Review Waiting on reviews from the maintainers labels Mar 15, 2026
@github-actions github-actions bot added this to the v1.0.0 milestone Mar 15, 2026
@github-actions
Copy link

github-actions bot commented Mar 15, 2026

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 50,079 50,080 +1
Ignored 2,072 2,072 0
Failed 812 811 -1
Panics 0 0 0
Conformance 94.55% 94.56% +0.00%
Fixed tests (1):
test/intl402/Temporal/PlainYearMonth/prototype/toLocaleString/datestyle-and-timestyle.js (previously Failed)

Tested main commit: 26271b7c3f6f357f12fd835a0402d8b643f03db5
Tested PR commit: fceb44a4e37de47b171fe2b919a45e4fef706734
Compare commits: 26271b7...fceb44a

@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.74%. Comparing base (6ddc2b4) to head (fceb44a).
⚠️ Report is 891 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5098       +/-   ##
===========================================
+ Coverage   47.24%   59.74%   +12.49%     
===========================================
  Files         476      580      +104     
  Lines       46892    63250    +16358     
===========================================
+ Hits        22154    37788    +15634     
- Misses      24738    25462      +724     

☔ 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.

@jedel1043 jedel1043 added the Blocked Waiting for another code change label Mar 16, 2026
@alienx5499 alienx5499 force-pushed the feat/5083-plainyearmonth-tolocalestring branch from f11323d to fceb44a Compare March 19, 2026 10:30
@github-actions github-actions bot added the Waiting On Review Waiting on reviews from the maintainers label Mar 19, 2026
@alienx5499 alienx5499 marked this pull request as ready for review March 19, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blocked Waiting for another code change C-Builtins PRs and Issues related to builtins/intrinsics C-Intl Changes related to the `Intl` implementation C-Tests Issues and PRs related to the tests. Waiting On Review Waiting on reviews from the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Temporal.PlainYearMonth.prototype.toLocaleString

2 participants