Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions spec/datetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ <h1>Abstract Operations For DateTimeFormat Objects</h1>
<td>*"day"*</td>
<td>*"2-digit"*, *"numeric"*</td>
</tr>
<tr>
<td>[[DayPeriod]]</td>
<td>*"dayPeriod"*</td>
<td>*"narrow"*, *"short"*, *"long"*</td>
</tr>
<tr>
<td>[[Hour]]</td>
<td>*"hour"*</td>
Expand Down Expand Up @@ -197,7 +202,7 @@ <h1>ToDateTimeOptions ( _options_, _required_, _defaults_ )</h1>
1. Let _value_ be ? Get(_options_, _prop_).
1. If _value_ is not *undefined*, let _needDefaults_ be *false*.
1. If _required_ is *"time"* or *"any"*, then
1. For each of the property names *"hour"*, *"minute"*, *"second"*, *"fractionalSecondDigits"*, do
1. For each of the property names *"dayPeriod"*, *"hour"*, *"minute"*, *"second"*, *"fractionalSecondDigits"*, do
1. Let _prop_ be the property name.
1. Let _value_ be ? Get(_options_, _prop_).
1. If _value_ is not *undefined*, let _needDefaults_ be *false*.
Expand Down Expand Up @@ -560,7 +565,7 @@ <h1>Intl.DateTimeFormat ( [ _locales_ [ , _options_ ] ] )</h1>

<emu-alg>
1. If NewTarget is *undefined*, let _newTarget_ be the active function object, else let _newTarget_ be NewTarget.
1. Let _dateTimeFormat_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%DateTimeFormat.prototype%"*, &laquo; [[InitializedDateTimeFormat]], [[Locale]], [[Calendar]], [[NumberingSystem]], [[TimeZone]], [[Weekday]], [[Era]], [[Year]], [[Month]], [[Day]], [[Hour]], [[Minute]], [[Second]], [[FractionalSecondDigits]], [[TimeZoneName]], [[HourCycle]], [[Pattern]], [[BoundFormat]] &raquo;).
1. Let _dateTimeFormat_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%DateTimeFormat.prototype%"*, &laquo; [[InitializedDateTimeFormat]], [[Locale]], [[Calendar]], [[NumberingSystem]], [[TimeZone]], [[Weekday]], [[Era]], [[Year]], [[Month]], [[Day]], [[DayPeriod]], [[Hour]], [[Minute]], [[Second]], [[FractionalSecondDigits]], [[TimeZoneName]], [[HourCycle]], [[Pattern]], [[BoundFormat]] &raquo;).
1. Perform ? InitializeDateTimeFormat(_dateTimeFormat_, _locales_, _options_).
</emu-alg>
<emu-normative-optional>
Expand Down Expand Up @@ -657,6 +662,9 @@ <h1>Internal slots</h1>
<li>hour, minute, second, fractionalSecondDigits</li>
<li>hour, minute, second</li>
<li>hour, minute</li>
<li>dayPeriod, hour</li>
<li>dayPeriod, hour, minute, second</li>
<li>dayPeriod, hour, minute</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have a good idea what's the most reasonable minimum subset for day-period display should be. So someone with more background in internalisation/localisation is probably a better reviewer for this specific part.

</ul>
Each of the records must also have a [[pattern]] field, whose value is a String value that contains for each of the date and time format component fields of the record a substring starting with *"{"*, followed by the name of the field, followed by *"}"*. If the record has an hour field, it must also have a [[pattern12]] field, whose value is a String value that, in addition to the substrings of the [[pattern]] field, contains a substring *"{ampm}"*. If the record has a [[year]] field, the [[pattern]] and [[pattern12]] values may contain the substrings *"{yearName}"* and *"{relatedYear}"*.
</li>
Expand Down Expand Up @@ -826,6 +834,10 @@ <h1>Intl.DateTimeFormat.prototype.resolvedOptions ( )</h1>
<td>[[Day]]</td>
<td>*"day"*</td>
</tr>
<tr>
<td>[[DayPeriod]]</td>
<td>*"dayPeriod"*</td>
</tr>
<tr>
<td>[[Hour]]</td>
<td>*"hour"*</td>
Expand Down Expand Up @@ -891,7 +903,7 @@ <h1>Properties of Intl.DateTimeFormat Instances</h1>
<li>[[Calendar]] is a String value with the *"type"* given in Unicode Technical Standard 35 for the calendar used for formatting.</li>
<li>[[NumberingSystem]] is a String value with the *"type"* given in Unicode Technical Standard 35 for the numbering system used for formatting.</li>
<li>[[TimeZone]] is a String value with the IANA time zone name of the time zone used for formatting.</li>
<li>[[Weekday]], [[Era]], [[Year]], [[Month]], [[Day]], [[Hour]], [[Minute]], [[Second]], [[TimeZoneName]] are each either *undefined*, indicating that the component is not used for formatting, or one of the String values given in <emu-xref href="#table-datetimeformat-components"></emu-xref>, indicating how the component should be presented in the formatted output.</li>
<li>[[Weekday]], [[Era]], [[Year]], [[Month]], [[Day]], [[DayPeriod]], [[Hour]], [[Minute]], [[Second]], [[TimeZoneName]] are each either *undefined*, indicating that the component is not used for formatting, or one of the String values given in <emu-xref href="#table-datetimeformat-components"></emu-xref>, indicating how the component should be presented in the formatted output.</li>
<li>[[FractionalSecondDigits]] is either *undefined* or a positive, non-negative integer Number value indicating the fraction digits to be used for fractional seconds. Numbers will be rounded or padded with trailing zeroes if necessary. </li>
<li>[[HourCycle]] is a String value indicating whether the 12-hour format (*"h11"*, *"h12"*) or the 24-hour format (*"h23"*, *"h24"*) should be used. *"h11"* and *"h23"* start with hour 0 and go up to 11 and 23 respectively. *"h12"* and *"h24"* start with hour 1 and go up to 12 and 24. [[HourCycle]] is only used when [[Hour]] is not *undefined*.</li>
<li>[[DateStyle]], [[TimeStyle]] are each either *undefined*, or a String value with values *"full"*, *"long"*, *"medium"*, or *"short"*.</li>
Expand Down