Normative: Call RegionPreference in WeekInfoOfLocale - #1051
Conversation
ptomato
left a comment
There was a problem hiding this comment.
This seems correct to me, as per First Day Overrides. Needs tests, I guess.
|
TG2 would like @FrankYFTang and the engine implementers to take a look (cc @Constellation @dminor). https://github.com/tc39/ecma402/blob/main/meetings/notes-2026-05-19.md#anbas-normative-prs |
|
could we show some test cases to show the vefore/after effect of this PR? |
gibson042
left a comment
There was a problem hiding this comment.
I like this; it's a glaring mistake for Intl.Locale.prototype.getWeekInfo to ignore -u-sd-… and -u-rg-… while Intl.Locale.prototype.getCalendars does not.
tc39/test262#5080 has test cases for getCalendars and getHourCycles. I'll wait for review on those, but then they can be adapted to getWeekInfo. |
`rg` and `sd` Unicode extension keys are valid for `WeekInfoOfLocale`. This matches existing ICU4C-based implementations.
|
Rebased. |
|
Isn't this what rgScope is for? https://www.unicode.org/reports/tr35/tr35-68/tr35-info.html#rgScope as a data item from CLDR - can we use that? |
|
Tests in tc39/test262#5090. V8 and JSC already pass these tests, which fits with Anba's description: "This matches existing ICU4C-based implementations." |
@srl295 Note that Richard commented on that topic in #1086 (review); I agree with his assessment that that'd be a larger effort, out of scope. See also #370 |
These tests are nearly identical to the other RegionPreference tests in tc39#5080. These are tests for the normative PR tc39/ecma402#1051, where we are adding the same RegionPreference fallback behaviour to getWeekInfo(). LLM disclosure: I used a bot to search for suitable input locale candidates.
rgandsdUnicode extension keys are valid forWeekInfoOfLocale.This matches existing ICU4C-based implementations.