Bug 209783

Summary: [ECMA-402] Fix Intl.DateTimeFormat patterns and fields in WebKit
Product: WebKit Reporter: Shane Carr <sffc>
Component: JavaScriptCoreAssignee: Ross Kirsling <ross.kirsling>
Status: RESOLVED FIXED    
Severity: Normal CC: andy, ews-watchlist, jeffm, keith_miller, mark.lam, mmaxfield, msaboff, ross.kirsling, saam, sffc, ticaiolima, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Shane Carr 2020-03-30 15:16:20 PDT
Two normative PRs in ECMA-402 changed some behavior relating to non-Gregorian calendars in Intl.DateTimeFormat:

- https://github.com/tc39/ecma402/pull/349
- https://github.com/tc39/ecma402/pull/351

V8 and SM now implement the new behavior described in those PRs.  WebKit users will get lower-quality i18n behavior relative to other browsers until these PRs are also fixed in WebKit.
Comment 1 Radar WebKit Bug Importer 2020-03-30 16:39:36 PDT
<rdar://problem/61079799>
Comment 2 Ross Kirsling 2020-04-12 21:01:44 PDT
Created attachment 396254 [details]
Patch
Comment 3 Ross Kirsling 2020-04-12 21:10:33 PDT
Comment on attachment 396254 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=396254&action=review

> JSTests/test262/config.yaml:159
> +    # These tests require macOS system ICU to actually update its CLDR data >:(
> +    # https://bugs.webkit.org/show_bug.cgi?id=209783
> +    - test/intl402/DateTimeFormat/prototype/format/related-year-zh.js
> +    - test/intl402/DateTimeFormat/prototype/formatToParts/related-year-zh.js

This is super frustrating, but evidently the CLDR data in current Catalina is much older than what should be included with ICU 64 (namely, CLDR 35).

You can see its zh locale data here:
https://opensource.apple.com/source/ICU/ICU-64243.0.1/icuSources/data/locales/zh.txt.auto.html

It lacks this change which should go back to at least ICU 60 (meaning all WK platforms are meant to have it):
https://github.com/unicode-org/icu/commit/77775f1b2d1e3999c0e64ee6db672eeefad9aa3e
Comment 4 Ross Kirsling 2020-04-12 21:26:46 PDT
Created attachment 396255 [details]
Patch
Comment 5 Keith Miller 2020-04-15 12:39:40 PDT
Comment on attachment 396255 [details]
Patch

r=me
Comment 6 EWS 2020-04-15 12:51:29 PDT
Committed r260145: <https://trac.webkit.org/changeset/260145>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 396255 [details].