Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Updates on fractionalSecondDigits in preparation for Temporal #715

Closed
wants to merge 3 commits into from
Closed
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
7 changes: 4 additions & 3 deletions spec/datetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ <h1>InitializeDateTimeFormat ( _dateTimeFormat_, _locales_, _options_ )</h1>
1. For each row of <emu-xref href="#table-datetimeformat-components"></emu-xref>, except the header row, in table order, do
1. Let _prop_ be the name given in the Property column of the row.
1. If _prop_ is *"fractionalSecondDigits"*, then
1. Let _value_ be ? GetNumberOption(_options_, *"fractionalSecondDigits"*, 1, 3, *undefined*).
1. Let _value_ be ? GetNumberOption(_options_, *"fractionalSecondDigits"*, 0, 9, *undefined*).
1. If _value_ is one of 0, 4, 5, 6, 7, 8, 9, set _value_ to *undefined*.
1. Else,
1. Let _values_ be a List whose elements are the strings given in the Values column of the row.
1. Let _value_ be ? GetOption(_options_, _prop_, ~string~, _values_, *undefined*).
Expand Down Expand Up @@ -736,7 +737,7 @@ <h1>Abstract Operations for DateTimeFormat Objects</h1>
<tr>
<td>[[FractionalSecondDigits]]</td>
<td>*"fractionalSecondDigits"*</td>
<td>*1*<sub>𝔽</sub>, *2*<sub>𝔽</sub>, *3*<sub>𝔽</sub></td>
<td>*1*<sub>𝔽</sub>, *2*<sub>𝔽</sub>, *3*<sub>𝔽</sub>, *4*<sub>𝔽</sub>, *5*<sub>𝔽</sub>, *6*<sub>𝔽</sub>, *7*<sub>𝔽</sub>, *8*<sub>𝔽</sub>, *9*<sub>𝔽</sub></td>
Copy link
Contributor

Choose a reason for hiding this comment

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

There seems to be a pre-existing inconsistency in ECMA-402 about whether [[FractionalSecondDigits]] contains Number or mathematical values. Properties of Intl.DateTimeFormat instances says either undefined or a "positive non-zero integer Number value" but step 36.d of InitializeDateTimeFormat stores a mathematical value (returned from GetNumberOption in step 36.b.i) in the slot.

In any case I'm not sure if it's necessary to amend this table, since a value > 3 passed for this option is converted to undefined. The other place where it could be used is for the info in the [[LocaleData]].[[<locale>]].[[formats]].[[<calendar>]] internal slots, in which it might be better to say "a positive non-zero integer" as well.

I bring this up from a test262 perspective, because I'm not sure whether the values in this cell of the table are observable in that they need to be tested in test262.

</tr>
<tr>
<td>[[TimeZoneName]]</td>
Expand Down Expand Up @@ -857,7 +858,7 @@ <h1>BasicFormatMatcher ( _options_, _formats_ )</h1>
1. Else if _optionsProp_ &ne; _formatProp_, decrease _score_ by _removalPenalty_.
1. Else if _optionsProp_ &ne; _formatProp_, then
1. If _property_ is *"fractionalSecondDigits"*, then
1. Let _values_ be &laquo; *1*<sub>𝔽</sub>, *2*<sub>𝔽</sub>, *3*<sub>𝔽</sub> &raquo;.
1. Let _values_ be &laquo; *1*<sub>𝔽</sub>, *2*<sub>𝔽</sub>, *3*<sub>𝔽</sub>, *4*<sub>𝔽</sub>, *5*<sub>𝔽</sub>, *6*<sub>𝔽</sub>, *7*<sub>𝔽</sub>, *8*<sub>𝔽</sub>, *9*<sub>𝔽</sub> &raquo;.
1. Else,
1. Let _values_ be &laquo; *"2-digit"*, *"numeric"*, *"narrow"*, *"short"*, *"long"* &raquo;.
1. Let _optionsPropIndex_ be the index of _optionsProp_ within _values_.
Expand Down