You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/datetimeformat.html
+47-37Lines changed: 47 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ <h1>
60
60
</dl>
61
61
62
62
<emu-alg>
63
-
1. Let _dateTimeFormat_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%DateTimeFormat.prototype%"*, « [[InitializedDateTimeFormat]], [[Locale]], [[Calendar]], [[NumberingSystem]], [[TimeZone]], [[HourCycle]], [[DateStyle]], [[TimeStyle]], [[DateTimeFormat]], [[BoundFormat]] »).
63
+
1. Let _dateTimeFormat_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Intl.DateTimeFormat.prototype%"*, « [[InitializedDateTimeFormat]], [[Locale]], [[Calendar]], [[NumberingSystem]], [[TimeZone]], [[HourCycle]], [[DateStyle]], [[TimeStyle]], [[DateTimeFormat]], [[BoundFormat]] »).
64
64
1. Let _requestedLocales_ be ? CanonicalizeLocaleList(_locales_).
65
65
1. Set _options_ to ? CoerceOptionsToObject(_options_).
66
66
1. Let _opt_ be a new Record.
@@ -129,7 +129,16 @@ <h1>
129
129
1. Set _dateTimeFormat_.[[DateStyle]] to _dateStyle_.
130
130
1. Let _timeStyle_ be ? GetOption(_options_, *"timeStyle"*, ~string~, «*"full"*, *"long"*, *"medium"*, *"short"*», *undefined*).
131
131
1. Set _dateTimeFormat_.[[TimeStyle]] to _timeStyle_.
132
-
1. If _dateStyle_ is *undefined* and _timeStyle_ is *undefined*, then
132
+
1. If _dateStyle_ is not *undefined* or _timeStyle_ is not *undefined*, then
133
+
1. If _hasExplicitFormatComponents_ is *true*, then
134
+
1. Throw a *TypeError* exception.
135
+
1. If _required_ is ~date~ and _timeStyle_ is not *undefined*, then
136
+
1. Throw a *TypeError* exception.
137
+
1. If _required_ is ~time~ and _dateStyle_ is not *undefined*, then
138
+
1. Throw a *TypeError* exception.
139
+
1. Let _styles_ be _resolvedLocaleData_.[[styles]].[[<_resolvedCalendar_>]].
140
+
1. Let _bestFormat_ be DateTimeStyleFormat(_dateStyle_, _timeStyle_, _styles_).
141
+
1. Else,
133
142
1. Let _needDefaults_ be *true*.
134
143
1. If _required_ is ~date~ or ~any~, then
135
144
1. For each property name _prop_ of «*"weekday"*, *"year"*, *"month"*, *"day"*», do
@@ -150,7 +159,7 @@ <h1>
150
159
1. Let _bestFormat_ be BasicFormatMatcher(_formatOptions_, _formats_).
151
160
1. Else,
152
161
1. Let _bestFormat_ be BestFitFormatMatcher(_formatOptions_, _formats_).
153
-
1. Set _dateTimeFormat_.[[Patterns]] to _bestFormat_.
162
+
1. Set _dateTimeFormat_.[[DateTimeFormat]] to _bestFormat_.
154
163
1. If _bestFormat_ has a field [[hour]], then
155
164
1. Set _dateTimeFormat_.[[HourCycle]] to _hc_.
156
165
1. Return _dateTimeFormat_.
@@ -247,7 +256,7 @@ <h1>Internal slots</h1>
247
256
[[LocaleData]].[[<_locale_>]].[[hourCycle24]] must be one of the String values *"h23"* or *"h24"*.
248
257
</li>
249
258
<li>
250
-
[[LocaleData]].[[<_locale_>]] must have a [[formats]] field. The value of this [[formats]] field must be a Record with a [[<_calendar_>]] field for each calendar value _calendar_. The value of each [[<_calendar_>]] field must be a List of DateTimeFormat Patterns Record. Multiple Records in such a List may use the same subset of the fields as long as the corresponding values differ for at least one field. The following subsets must be available for each locale:
259
+
[[LocaleData]].[[<_locale_>]] must have a [[formats]] field. The value of this [[formats]] field must be a Record with a [[<_calendar_>]] field for each calendar value _calendar_. The value of each [[<_calendar_>]] field must be a List of DateTime Format Records. Multiple Records in such a List may use the same subset of the fields as long as the corresponding values differ for at least one field. The following subsets must be available for each locale:
[[LocaleData]].[[<_locale_>]] must have a [[styles]] field. The value of this [[styles]] field must be a Record with a [[<_calendar_>]] field for each calendar value _calendar_. The value of each [[<_calendar_>]] field must be a DateTimeFormat Styles Record.
276
+
[[LocaleData]].[[<_locale_>]] must have a [[styles]] field. The value of this [[styles]] field must be a Record with a [[<_calendar_>]] field for each calendar value _calendar_. The value of each [[<_calendar_>]] field must be a DateTime Styles Record.
Each <dfnid="datetimeformat-patterns-record"variants="DateTimeFormat Patterns Records">DateTimeFormat Patterns Record</dfn> has the fields defined in <emu-xrefhref="#table-datetimeformat-patterns-record"></emu-xref>.
284
+
Each <dfnid="datetimeformat-format-record"variants="DateTime Format Records">DateTime Format Record</dfn> has the fields defined in <emu-xrefhref="#table-datetimeformat-format-record"></emu-xref>.
Each <dfnid="datetimeformat-calendar-style-record">DateTime Calendar Style Record</dfn> has the fields defined in <emu-xrefhref="#table-datetimeformat-calendar-style-record"></emu-xref>.
564
+
Each <dfnid="datetimeformat-styles-record">DateTime Styles Record</dfn> has the fields defined in <emu-xrefhref="#table-datetimeformat-styles-record"></emu-xref>.
_dateStyle_: *"full"*, *"long"*, *"medium"*, *"short"*, or *undefined*,
1243
1252
_timeStyle_: *"full"*, *"long"*, *"medium"*, *"short"*, or *undefined*,
1244
-
_styles_: a DateTime Calendar Style Record,
1253
+
_styles_: a DateTime Styles Record,
1245
1254
): a DateTime Format Record
1246
1255
</h1>
1247
1256
<dlclass="header">
@@ -1252,15 +1261,15 @@ <h1>
1252
1261
1.Assert:_dateStyle_ is not *undefined* or _timeStyle_ is not *undefined*.
1253
1262
1. If _timeStyle_ is not *undefined*, then
1254
1263
1.Assert:_timeStyle_ is one of *"full"*, *"long"*, *"medium"*, or *"short"*.
1255
-
1. Let _timeFormat_ be _styles_.[[TimeFormat]].[[<_timeStyle_>]].
1264
+
1. Let _timeFormat_ be _styles_.[[Time]].[[<_timeStyle_>]].
1256
1265
1. If _dateStyle_ is not *undefined*, then
1257
1266
1.Assert:_dateStyle_ is one of *"full"*, *"long"*, *"medium"*, or *"short"*.
1258
-
1. Let _dateFormat_ be _styles_.[[DateFormat]].[[<_dateStyle_>]].
1267
+
1. Let _dateFormat_ be _styles_.[[Date]].[[<_dateStyle_>]].
1259
1268
1. If _dateStyle_ is not *undefined* and _timeStyle_ is not *undefined*, then
1260
1269
1. Let _format_ be a new DateTime Format Record.
1261
1270
1. Add to _format_ all fields from _dateFormat_ except [[pattern]] and [[rangePatterns]].
1262
1271
1. Add to _format_ all fields from _timeFormat_ except [[pattern]], [[rangePatterns]], [[pattern12]], and [[rangePatterns12]], if present.
1263
-
1. Let _connector_ be _styles_.[[DateTimeFormat]].[[<_dateStyle_>]].
1272
+
1. Let _connector_ be _styles_.[[Connector]].[[<_dateStyle_>]].
1264
1273
1. Let _pattern_ be the string _connector_ with the substring *"{0}"* replaced with _timeFormat_.[[pattern]] and the substring *"{1}"* replaced with _dateFormat_.[[pattern]].
1265
1274
1. Set _format_.[[pattern]] to _pattern_.
1266
1275
1. If _timeFormat_ has a [[pattern12]] field, then
1. Let _nf3_ be ! Construct(%Intl.NumberFormat%, «_locale_, _nf3Options_»).
1412
1421
1. Let _tm_ be ToLocalTime(ℤ(ℝ(_x_) × 10<sup>6</sup>), _dateTimeFormat_.[[Calendar]], _dateTimeFormat_.[[TimeZone]]).
1413
1422
1. Let _patternParts_ be PartitionPattern(_pattern_).
1414
1423
1. Let _result_ be a new empty List.
1415
1424
1. For each Record { [[Type]], [[Value]] } _patternPart_ of _patternParts_, do
1416
1425
1. Let _p_ be _patternPart_.[[Type]].
1417
1426
1. If _p_ is *"literal"*, then
1418
1427
1. Append the Record { [[Type]]: *"literal"*, [[Value]]: _patternPart_.[[Value]] } to _result_.
1419
-
1. Else if _p_ is equal to *"fractionalSecondDigits"*, then
1428
+
1. Else if _p_ is *"fractionalSecondDigits"*, then
1420
1429
1.Assert:_format_ has a field [[fractionalSecondDigits]].
1421
1430
1. Let _v_ be _tm_.[[Millisecond]].
1422
1431
1. Set _v_ to floor(_v_× 10<sup>( _fractionalSecondDigits_ - 3 )</sup>).
1423
1432
1. Let _fv_ be FormatNumeric(_nf3_, _v_).
1424
1433
1. Append the Record { [[Type]]: *"fractionalSecond"*, [[Value]]: _fv_ } to _result_.
1425
-
1. Else if _p_ is equal to *"dayPeriod"*, then
1434
+
1. Else if _p_ is *"dayPeriod"*, then
1426
1435
1.Assert:_format_ has a field [[dayPeriod]].
1427
1436
1. Let _f_ be _format_.[[dayPeriod]].
1428
1437
1. Let _fv_ be a String value representing the day period of _tm_ in the form given by _f_; the String value depends upon the implementation and the effective locale of _dateTimeFormat_.
1429
1438
1. Append the Record { [[Type]]: _p_, [[Value]]: _fv_ } to _result_.
1430
-
1. Else if _p_ is equal to *"timeZoneName"*, then
1439
+
1. Else if _p_ is *"timeZoneName"*, then
1431
1440
1.Assert:_format_ has a field [[timeZoneName]].
1432
1441
1. Let _f_ be _format_.[[timeZoneName]].
1433
1442
1. Let _v_ be _dateTimeFormat_.[[TimeZone]].
@@ -1468,7 +1477,7 @@ <h1>
1468
1477
1. Let _v_ be _tm_.[[RelatedYear]].
1469
1478
1. Let _fv_ be FormatNumeric(_nf_, _v_).
1470
1479
1. Append the Record { [[Type]]: *"relatedYear"*, [[Value]]: _fv_ } to _result_.
1471
-
1. Else if _p_ is equal to *"yearName"*, then
1480
+
1. Else if _p_ is *"yearName"*, then
1472
1481
1. Let _v_ be _tm_.[[YearName]].
1473
1482
1. Let _fv_ be an implementation and locale dependent String value representing _v_.
1474
1483
1. Append the Record { [[Type]]: *"yearName"*, [[Value]]: _fv_ } to _result_.
@@ -1590,9 +1599,10 @@ <h1>
1590
1599
1. Let _v1_ be a String value representing the day period of _tm1_; the String value depends upon the implementation and the effective locale of _dateTimeFormat_.
1591
1600
1. Let _v2_ be a String value representing the day period of _tm2_; the String value depends upon the implementation and the effective locale of _dateTimeFormat_.
1592
1601
1. Else if _fieldName_ is [[FractionalSecondDigits]], then
1593
-
1. Let _fractionalSecondDigits_ be _dateTimeFormat_.[[FractionalSecondDigits]].
1594
-
1. If _fractionalSecondDigits_ is *undefined*, then
1595
-
1. Set _fractionalSecondDigits_ to 3.
1602
+
1. If _format_ has a [[fractionalSecondDigits]] field, then
1603
+
1. Let _fractionalSecondDigits_ be _format_.[[fractionalSecondDigits]].
1604
+
1. Else,
1605
+
1. Let _fractionalSecondDigits_ be 3.
1596
1606
1. Let _exp_ be _fractionalSecondDigits_ - 3.
1597
1607
1. Let _v1_ be floor(_tm1_.[[Millisecond]] × 10<sup>_exp_</sup>).
1598
1608
1. Let _v2_ be floor(_tm2_.[[Millisecond]] × 10<sup>_exp_</sup>).
@@ -1604,7 +1614,7 @@ <h1>
1604
1614
1. If _relevantFieldsEqual_ is *true*, then
1605
1615
1. Let _collapsedResult_ be a new empty List.
1606
1616
1. Let _resultParts_ be ! FormatDateTimePattern(_dateTimeFormat_, _format_, _pattern_, _x_).
1607
-
1. For each Record { [[Type]], [[Value]] } _r_in_resultParts_, do
1617
+
1. For each Record { [[Type]], [[Value]] } _r_of_resultParts_, do
1608
1618
1. Append the Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: *"shared"* } to _collapsedResult_.
1609
1619
1. Return _collapsedResult_.
1610
1620
1. Let _rangeResult_ be a new empty List.
@@ -1618,7 +1628,7 @@ <h1>
1618
1628
1. Else,
1619
1629
1. Let _z_ be _y_.
1620
1630
1. Let _resultParts_ be ! FormatDateTimePattern(_dateTimeFormat_, _selectedRangePattern_, _pattern_, _z_).
1621
-
1. For each Record { [[Type]], [[Value]] } _r_in_resultParts_, do
1631
+
1. For each Record { [[Type]], [[Value]] } _r_of_resultParts_, do
1622
1632
1. Append the Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: _source_ } to _rangeResult_.
Copy file name to clipboardExpand all lines: spec/locale-sensitive-functions.html
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -83,9 +83,8 @@ <h1>
83
83
1. Let _requestedLocale_ be _requestedLocales_[0].
84
84
1. Else,
85
85
1. Let _requestedLocale_ be DefaultLocale().
86
-
1. Let _noExtensionsLocale_ be the String value that is _requestedLocale_ with any Unicode locale extension sequences removed.
87
86
1. Let _availableLocales_ be an Available Locales List which includes the language tags for which the Unicode Character Database contains language-sensitive case mappings. If the implementation supports additional locale-sensitive case mappings, _availableLocales_ should also include their corresponding language tags.
88
-
1. Let _match_ be LookupMatchingLocaleByPrefix(_availableLocales_, _noExtensionsLocale_).
87
+
1. Let _match_ be LookupMatchingLocaleByPrefix(_availableLocales_, «_requestedLocale_»).
89
88
1. If _match_ is not *undefined*, let _locale_ be _match_.[[locale]]; else let _locale_ be *"und"*.
Copy file name to clipboardExpand all lines: spec/locales-currencies-tz.html
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -212,8 +212,6 @@ <h1>AvailableNamedTimeZoneIdentifiers ( ): a List of Time Zone Identifier Record
212
212
Its result describes all available named time zone identifiers in this implementation, as well as the primary time zone identifier corresponding to each available named time zone identifier.
213
213
The List is ordered according to the [[Identifier]] field of each Time Zone Identifier Record.
214
214
</dd>
215
-
<dt>redefinition</dt>
216
-
<dd>true</dd>
217
215
</dl>
218
216
<p>This definition supersedes the definition provided in <emu-xrefhref="#sec-availablenamedtimezoneidentifiers"></emu-xref>.</p>
0 commit comments