@@ -85,6 +85,7 @@ <h1>InitializeDateTimeFormat ( _dateTimeFormat_, _locales_, _options_ )</h1>
85
85
1. Set _timeZone_ to ! CanonicalizeTimeZoneName(_timeZone_ ).
86
86
1. Set _dateTimeFormat_ .[[TimeZone]] to _timeZone_ .
87
87
1. Let _formatOptions_ be a new Record.
88
+ 1. Let _hasExplicitFormatComponents_ be *false* .
88
89
1. For each row of <emu-xref href =" #table-datetimeformat-components" ></emu-xref >, except the header row, in table order, do
89
90
1. Let _prop_ be the name given in the Property column of the row.
90
91
1. If _prop_ is *"fractionalSecondDigits"* , then
@@ -93,6 +94,7 @@ <h1>InitializeDateTimeFormat ( _dateTimeFormat_, _locales_, _options_ )</h1>
93
94
1. Let _values_ be a List whose elements are the strings given in the Values column of the row.
94
95
1. Let _value_ be ? GetOption(_options_ , _prop_ , *"string"* , _values_ , *undefined* ).
95
96
1. Set _formatOptions_ .[[< ; _prop_ > ; ]] to _value_ .
97
+ 1. If _value_ is not *undefined* , set _hasExplicitFormatComponents_ to *true* .
96
98
1. Let _dataLocaleData_ be _localeData_ .[[< ; _dataLocale_ > ; ]].
97
99
1. Let _hcDefault_ be _dataLocaleData_ .[[hourCycle]].
98
100
1. Let _hc_ be _dateTimeFormat_ .[[HourCycle]].
@@ -118,10 +120,7 @@ <h1>InitializeDateTimeFormat ( _dateTimeFormat_, _locales_, _options_ )</h1>
118
120
1. Let _timeStyle_ be ? GetOption(_options_ , *"timeStyle"* , *"string"* , « ; *"full"* , *"long"* , *"medium"* , *"short"* » ; , *undefined* ).
119
121
1. Set _dateTimeFormat_ .[[TimeStyle]] to _timeStyle_ .
120
122
1. If _dateStyle_ is not *undefined* or _timeStyle_ is not *undefined* , then
121
- 1. For each row in <emu-xref href =" #table-datetimeformat-components" ></emu-xref >, except the header row, do
122
- 1. Let _prop_ be the name given in the Property column of the row.
123
- 1. If _formatOptions_ .[[< ; _prop_ > ; ]] is present and its value is not *undefined* , then
124
- 1. Throw a *TypeError* exception.
123
+ 1. If _hasExplicitFormatComponents_ is *true* , throw a *TypeError* exception.
125
124
1. Let _styles_ be _dataLocaleData_ .[[styles]].[[< ; _calendar_ > ; ]].
126
125
1. Let _bestFormat_ be DateTimeStyleFormat(_dateStyle_ , _timeStyle_ , _styles_ ).
127
126
1. Else,
0 commit comments