Skip to content

Commit

Permalink
Set FirstDay to "mon" and MinimalDays to 4 if calendar is "iso8601"
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankYFTang committed Jul 9, 2024
1 parent e904c4b commit 896320f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,7 @@ <h1><span class="secnum">1.1.10</span> WeekInfoOfLocale ( <var>loc</var> )</h1>
<p>
The abstract operation WeekInfoOfLocale accepts the argument <var>loc</var> , and performs the following steps:
</p>
<emu-alg><ol><li>Let <var>locale</var> be <var>loc</var>.[[Locale]].</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>locale</var> matches the <code>unicode_locale_id</code> production.</li><li>Let <var>r</var> be a record whose fields are defined by <emu-xref href="#table-locale-weekinfo-record" id="_ref_2"><a href="#table-locale-weekinfo-record">Table 2</a></emu-xref>, with values based on <var>locale</var>.</li><li>Let <var>fws</var> be <var>loc</var>.[[FirstDayOfWeek]].</li><li>Let <var>fw</var> be !<emu-xref aoid="StringToWeekdayValue" id="_ref_17"><a href="#sec-string-to-weekday-value">StringToWeekdayValue</a></emu-xref>(<var>fws</var>).</li><li>If <var>fw</var> is not <emu-val>undefined</emu-val>, then<ol><li>Set <var>r</var>.[[FirstDay]] to <var>fw</var>.</li></ol></li><li>Return <var>r</var>.</li></ol></emu-alg>
<emu-alg><ol><li>Let <var>locale</var> be <var>loc</var>.[[Locale]].</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>locale</var> matches the <code>unicode_locale_id</code> production.</li><li>Let <var>r</var> be a record whose fields are defined by <emu-xref href="#table-locale-weekinfo-record" id="_ref_2"><a href="#table-locale-weekinfo-record">Table 2</a></emu-xref>, with values based on <var>locale</var>.</li><li>Let <var>ca</var> be <var>loc</var>.[[Calendar]].</li><li>If <var>ca</var> is <emu-val>"iso8601"</emu-val>, then<ol><li>Set <var>r</var>.[[FirstDay]] to <emu-val>"mon"</emu-val>.</li><li>Set <var>r</var>.[[MinimalDays]] to <emu-val>4</emu-val>.</li></ol></li><li>Let <var>fws</var> be <var>loc</var>.[[FirstDayOfWeek]].</li><li>Let <var>fw</var> be !<emu-xref aoid="StringToWeekdayValue" id="_ref_17"><a href="#sec-string-to-weekday-value">StringToWeekdayValue</a></emu-xref>(<var>fws</var>).</li><li>If <var>fw</var> is not <emu-val>undefined</emu-val>, then<ol><li>Set <var>r</var>.[[FirstDay]] to <var>fw</var>.</li></ol></li><li>Return <var>r</var>.</li></ol></emu-alg>

<emu-table id="table-locale-weekinfo-record"><figure><figcaption>Table 2: WeekInfo <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">Record</a></emu-xref> Fields</figcaption>

Expand Down
4 changes: 4 additions & 0 deletions locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ <h1>WeekInfoOfLocale ( _loc_ )</h1>
1. Let _locale_ be _loc_.[[Locale]].
1. Assert: _locale_ matches the `unicode_locale_id` production.
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_.
1. Let _ca_ be _loc_.[[Calendar]].
1. If _ca_ is *"iso8601"*, then
1. Set _r_.[[FirstDay]] to *"mon"*.
1. Set _r_.[[MinimalDays]] to *4*.
1. Let _fws_ be _loc_.[[FirstDayOfWeek]].
1. Let _fw_ be !StringToWeekdayValue(_fws_).
1. If _fw_ is not *undefined*, then
Expand Down

0 comments on commit 896320f

Please sign in to comment.