Skip to content

Normative: Call RegionPreference in WeekInfoOfLocale - #1051

Merged
gibson042 merged 3 commits into
tc39:mainfrom
anba:weekinfo-region
Jul 22, 2026
Merged

Normative: Call RegionPreference in WeekInfoOfLocale#1051
gibson042 merged 3 commits into
tc39:mainfrom
anba:weekinfo-region

Conversation

@anba

@anba anba commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

rg and sd Unicode extension keys are valid for WeekInfoOfLocale.

This matches existing ICU4C-based implementations.

@ptomato ptomato left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems correct to me, as per First Day Overrides. Needs tests, I guess.

@sffc

sffc commented May 19, 2026

Copy link
Copy Markdown
Contributor

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

@ptomato ptomato added s: discuss Status: TG2 must discuss to move forward needs review labels May 29, 2026
@sffc sffc moved this to Priority Issues in ECMA-402 Meeting Topics Jun 10, 2026
@FrankYFTang

Copy link
Copy Markdown
Contributor

could we show some test cases to show the vefore/after effect of this PR?

@sffc sffc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM since this makes WeekInfoOfLocale more consistent with CalendarsOfLocale, HourCyclesOfLocale, ...

@gibson042 gibson042 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread spec/locale.html Outdated
@sffc

sffc commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

@ptomato

ptomato commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

could we show some test cases to show the vefore/after effect of this PR?

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.
@ptomato

ptomato commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Rebased.

@srl295

srl295 commented Jul 18, 2026

Copy link
Copy Markdown
Member

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?

@ptomato

ptomato commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Tests in tc39/test262#5090. V8 and JSC already pass these tests, which fits with Anba's description: "This matches existing ICU4C-based implementations."

@ptomato

ptomato commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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?

@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

Comment thread spec/locale.html Outdated
@gibson042
gibson042 merged commit b7dfc3c into tc39:main Jul 22, 2026
2 checks passed
gibson042 pushed a commit to ptomato/test262 that referenced this pull request Jul 23, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs consensus needs review normative s: discuss Status: TG2 must discuss to move forward

Projects

Status: Previously Discussed

Development

Successfully merging this pull request may close these issues.

7 participants