Skip to content

Commit f6c6b8f

Browse files
anbaptomato
authored andcommitted
Normative: Call RegionPreference in WeekInfoOfLocale
`rg` and `sd` Unicode extension keys are valid for `WeekInfoOfLocale`. This matches existing ICU4C-based implementations.
1 parent 5273ed8 commit f6c6b8f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

spec/locale.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,8 +871,14 @@ <h1>
871871
<dd>The following algorithm refers to Locale data specified in <a href="https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Patterns_Week_Elements">Unicode Technical Standard #35 Part 4 Dates, Week Elements</a>.</dd>
872872
</dl>
873873
<emu-alg>
874-
1. Let _locale_ be _loc_.[[Locale]].
875-
1. Let _weekInfo_ be a Record whose fields are defined by <emu-xref href="#table-locale-weekinfo-record"></emu-xref>, with values based on _locale_.
874+
1. Let _preference_ be RegionPreference(_loc_.[[Locale]]).
875+
1. Let _region_ be _preference_.[[Region]].
876+
1. Let _regionOverride_ be _preference_.[[RegionOverride]].
877+
1. If _regionOverride_ is not *undefined* and week data for _regionOverride_ are available, then
878+
1. Let _lookupRegion_ be _regionOverride_.
879+
1. Else,
880+
1. Let _lookupRegion_ be _region_.
881+
1. Let _weekInfo_ be a Record whose fields are defined by <emu-xref href="#table-locale-weekinfo-record"></emu-xref>, with values based on _lookupRegion_. If no week data for _lookupRegion_ is available, the week data for region *"001"* is used.
876882
1. Let _firstDayString_ be _loc_.[[FirstDayOfWeek]].
877883
1. If _firstDayString_ is not *undefined*, then
878884
1. Let _firstDay_ be WeekdayUValueToNumber(_firstDayString_).

0 commit comments

Comments
 (0)