Bug 231041

Summary: [JSC] DateTimeFormat.resolvedOptions shouldn't return an object with other date/time properties if dateStyle or timeStyle are set
Product: WebKit Reporter: Philip Chimento <philip.chimento>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, fpizlo, keith_miller, kevin_neal, mark.lam, msaboff, philip.chimento, ross.kirsling, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Philip Chimento
Reported 2021-09-30 15:57:13 PDT
According to the specification for Intl.DateTimeFormat.prototype.resolvedOptions() (https://tc39.es/ecma402/#sec-intl.datetimeformat.prototype.resolvedoptions) step 5.d, none of the properties in Table 4 (weekday, era, year, month, day, dayPeriod, hour, minute, second, fractionalSecondDigits, timeZoneName) should be present on the returned object if dateStyle or timeStyle are present. JavaScriptCore currently does not implement this step correctly: > new Intl.DateTimeFormat('en', {dateStyle:'short'}).resolvedOptions().year "2-digit" This means you currently cannot always pass the object returned from resolvedOptions() back into the DateTimeFormat constructor as the options argument, for one thing.
Attachments
Patch (7.80 KB, patch)
2021-10-02 14:51 PDT, Yusuke Suzuki
no flags
Kevin Neal
Comment 1 2021-10-01 14:31:12 PDT
Thank you for filing. The appropriate engineers have been notified.
Radar WebKit Bug Importer
Comment 2 2021-10-01 14:31:27 PDT
Yusuke Suzuki
Comment 3 2021-10-02 14:51:22 PDT
Ross Kirsling
Comment 4 2021-10-02 16:33:21 PDT
Comment on attachment 439973 [details] Patch r=me, but we should make sure this gets captured in test262.
EWS
Comment 5 2021-10-02 19:13:26 PDT
Committed r283460 (242439@main): <https://commits.webkit.org/242439@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 439973 [details].
Note You need to log in before you can comment on or make changes to this bug.