Skip to content

Commit 4c469d0

Browse files
committed
Normative: Call RegionPreference in WeekInfoOfLocale
`rg` and `sd` Unicode extension keys are valid for `WeekInfoOfLocale`. This matches existing ICU4C-based implementations.
1 parent 4781b0d commit 4c469d0

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
@@ -861,8 +861,14 @@ <h1>
861861
<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>
862862
</dl>
863863
<emu-alg>
864-
1. Let _locale_ be _loc_.[[Locale]].
865-
1. Let _r_ be a Record whose fields are defined by <emu-xref href="#table-locale-weekinfo-record"></emu-xref>, with values based on _locale_.
864+
1. Let _preference_ be RegionPreference(_loc_.[[Locale]]).
865+
1. Let _region_ be _preference_.[[Region]].
866+
1. Let _regionOverride_ be _preference_.[[RegionOverride]].
867+
1. If _regionOverride_ is not *undefined* and week data for _regionOverride_ are available, then
868+
1. Let _lookupRegion_ be _regionOverride_.
869+
1. Else,
870+
1. Let _lookupRegion_ be _region_.
871+
1. Let _r_ 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 *"001"* is used.
866872
1. Let _fws_ be _loc_.[[FirstDayOfWeek]].
867873
1. Let _fw_ be WeekdayUValueToNumber(_fws_).
868874
1. If _fw_ is not *undefined*, then

0 commit comments

Comments
 (0)