Skip to content

feat(intl): implement Intl.DateTimeFormat.prototype.resolvedOptions()#4753

Open
Lokesh0224 wants to merge 4 commits intoboa-dev:mainfrom
Lokesh0224:impl-datetimeformat-resolved-options
Open

feat(intl): implement Intl.DateTimeFormat.prototype.resolvedOptions()#4753
Lokesh0224 wants to merge 4 commits intoboa-dev:mainfrom
Lokesh0224:impl-datetimeformat-resolved-options

Conversation

@Lokesh0224
Copy link
Contributor

@Lokesh0224 Lokesh0224 commented Feb 27, 2026

Fixes the missing resolvedOptions() on DateTimeFormat — it was throwing
TypeError: not a callable function.

This PR implements the method following the
ECMA-402 11.3.2. Added the missing internal slots (numbering_system, hour_cycle, date_style, time_style) to the struct and populated them during construction.

LIMITATION
unicode-org/icu4x#5868
ICU4X does not yet expose the resolved calendar, numberingSystem, and hourCycle
from a constructed DateTimeFormatter, so ECMA-402 defaults are used as fallbacks.
Explicitly passed options are always reflected correctly.

Test262 resolvedOptions: 1/21 → 6/21

before resolvedOptoins():
Screenshot from 2026-02-27 13-08-09

after resolvedOptoins():
image

@github-actions
Copy link

github-actions bot commented Feb 27, 2026

Test262 conformance changes

Test result main count PR count difference
Total 52,862 52,862 0
Passed 49,505 49,524 +19
Ignored 2,261 2,261 0
Failed 1,096 1,077 -19
Panics 0 0 0
Conformance 93.65% 93.69% +0.04%
Fixed tests (28):
test/intl402/default-locale-is-canonicalized.js (previously Failed)
test/intl402/fallback-locales-are-supported.js (previously Failed)
test/intl402/constructors-taint-Object-prototype.js (previously Failed)
test/intl402/constructors-taint-Object-prototype-2.js (previously Failed)
test/intl402/DateTimeFormat/test-option-localeMatcher.js (previously Failed)
test/intl402/DateTimeFormat/constructor-options-toobject.js (previously Failed)
test/intl402/DateTimeFormat/test-option-formatMatcher.js (previously Failed)
test/intl402/DateTimeFormat/numbering-system-calendar-options.js (previously Failed)
test/intl402/DateTimeFormat/constructor-options-timeStyle-valid.js (previously Failed)
test/intl402/DateTimeFormat/constructor-options-dateStyle-valid.js (previously Failed)
test/intl402/DateTimeFormat/taint-Object-prototype-date-time-components.js (previously Failed)
test/intl402/DateTimeFormat/constructor-default-value.js (previously Failed)
test/intl402/DateTimeFormat/taint-Object-prototype-dayPeriod.js (previously Failed)
test/intl402/DateTimeFormat/taint-Object-prototype-fractionalSecondDigits.js (previously Failed)
test/intl402/DateTimeFormat/casing-numbering-system-calendar-options.js (previously Failed)
test/intl402/DateTimeFormat/canonicalize-calendar.js (previously Failed)
test/intl402/DateTimeFormat/taint-Object-prototype.js (previously Failed)
test/intl402/DateTimeFormat/ignore-invalid-unicode-ext-values.js (previously Failed)
test/intl402/DateTimeFormat/prototype/formatToParts/temporal-zoneddatetime-not-supported.js (previously Failed)
test/intl402/DateTimeFormat/prototype/formatRangeToParts/temporal-zoneddatetime-not-supported.js (previously Failed)
test/intl402/DateTimeFormat/prototype/formatRange/temporal-zoneddatetime-not-supported.js (previously Failed)
test/intl402/DateTimeFormat/prototype/format/temporal-zoneddatetime-not-supported.js (previously Failed)
test/intl402/DateTimeFormat/prototype/resolvedOptions/length.js (previously Failed)
test/intl402/DateTimeFormat/prototype/resolvedOptions/builtin.js (previously Failed)
test/intl402/DateTimeFormat/prototype/resolvedOptions/name.js (previously Failed)
test/intl402/DateTimeFormat/prototype/resolvedOptions/resolved-hour-cycle-unicode-extensions-and-options.js (previously Failed)
test/intl402/DateTimeFormat/prototype/resolvedOptions/prop-desc.js (previously Failed)
test/built-ins/RegExp/named-groups/non-unicode-property-names-valid.js (previously Ignored)
Broken tests (8):
test/built-ins/RegExp/prototype/exec/regexp-builtin-exec-v-u-flag.js (previously Passed)
test/built-ins/String/prototype/replace/regexp-prototype-replace-v-u-flag.js (previously Passed)
test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-v-u-flag.js (previously Passed)
test/built-ins/String/prototype/search/regexp-prototype-search-v-u-flag.js (previously Passed)
test/built-ins/String/prototype/search/regexp-prototype-search-v-flag.js (previously Passed)
test/built-ins/String/prototype/match/regexp-prototype-match-v-u-flag.js (previously Passed)
test/staging/sm/RegExp/unicode-raw.js (previously Passed)
test/staging/sm/RegExp/unicode-class-raw.js (previously Passed)

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 25.92593% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.18%. Comparing base (6ddc2b4) to head (c7059c2).
⚠️ Report is 701 commits behind head on main.

Files with missing lines Patch % Lines
...e/engine/src/builtins/intl/date_time_format/mod.rs 25.92% 60 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4753      +/-   ##
==========================================
+ Coverage   47.24%   57.18%   +9.94%     
==========================================
  Files         476      552      +76     
  Lines       46892    60572   +13680     
==========================================
+ Hits        22154    34638   +12484     
- Misses      24738    25934    +1196     

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

@Lokesh0224 Lokesh0224 force-pushed the impl-datetimeformat-resolved-options branch from 3a63f16 to c7059c2 Compare February 28, 2026 06:09
@Lokesh0224
Copy link
Contributor Author

@jedel1043, can you kindly go through the chat regarding // TODO: determine the correct way to verify the calendar algorithm data.

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