forked from tc39/proposal-intl-datetime-style
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec.html
463 lines (425 loc) · 23.4 KB
/
spec.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
<pre class="metadata">
title: dateStyle and timeStyle options for DateTimeFormat
status: proposal
stage: 3
location: https://tc39.github.io/proposal-ecma402-datetime-style/
copyright: false
contributors: Zibi Braniecki, Daniel Ehrenberg
</pre>
<emu-biblio href="./biblio.json"></emu-biblio>
<emu-intro id="sec-intro">
<h1>Introduction</h1>
<p>This proposal adds two options to `Intl.DateTimeFormat`: `dateStyle` and `timeStyle`. These options give a compact way to request the appropriate, locale-specific way to ask for a date and time of given lengths. See <a href="https://github.com/tc39/proposal-ecma402-datetime-style/blob/master/README.md">the README</a> for more context.</p>
</emu-intro>
<emu-clause id="datetimeformat-objects">
<h1>DateTimeFormat Objects</h1>
<emu-clause id="sec-datetimeformat-abstracts">
<h1>Abstract Operations For DateTimeFormat Objects</h1>
<p>
Several DateTimeFormat algorithms use values from the following table, which provides internal slots, property names and allowable values for the components of date and time formats:
</p>
<emu-table id="table-datetimeformat-components">
<emu-caption>Components of date and time formats</emu-caption>
<table class="real-table">
<thead>
<tr>
<th>Internal Slot</th>
<th>Property</th>
<th>Values</th>
</tr>
</thead>
<tr>
<td>[[Weekday]]</td>
<td>`"weekday"`</td>
<td>`"narrow"`, `"short"`, `"long"`</td>
</tr>
<tr>
<td>[[Era]]</td>
<td>`"era"`</td>
<td>`"narrow"`, `"short"`, `"long"`</td>
</tr>
<tr>
<td>[[Year]]</td>
<td>`"year"`</td>
<td>`"2-digit"`, `"numeric"`</td>
</tr>
<tr>
<td>[[Month]]</td>
<td>`"month"`</td>
<td>`"2-digit"`, `"numeric"`, `"narrow"`, `"short"`, `"long"`</td>
</tr>
<tr>
<td>[[Day]]</td>
<td>`"day"`</td>
<td>`"2-digit"`, `"numeric"`</td>
</tr>
<tr>
<td>[[Hour]]</td>
<td>`"hour"`</td>
<td>`"2-digit"`, `"numeric"`</td>
</tr>
<tr>
<td>[[Minute]]</td>
<td>`"minute"`</td>
<td>`"2-digit"`, `"numeric"`</td>
</tr>
<tr>
<td>[[Second]]</td>
<td>`"second"`</td>
<td>`"2-digit"`, `"numeric"`</td>
</tr>
<tr>
<td>[[TimeZoneName]]</td>
<td>`"timeZoneName"`</td>
<td>`"short"`, `"long"`</td>
</tr>
</table>
</emu-table>
<emu-clause id="sec-initializedatetimeformat" aoid="InitializeDateTimeFormat">
<h1>InitializeDateTimeFormat ( _dateTimeFormat_, _locales_, _options_ )</h1>
<p>
The abstract operation InitializeDateTimeFormat accepts the arguments _dateTimeFormat_ (which must be an object), _locales_, and _options_. It initializes _dateTimeFormat_ as a DateTimeFormat object. This abstract operation functions as follows:
</p>
<emu-alg>
1. Let _requestedLocales_ be ? CanonicalizeLocaleList(_locales_).
1. Let _options_ be ? ToDateTimeOptions(_options_, `"any"`, `"date"`).
1. Let _opt_ be a new Record.
1. Let _matcher_ be ? GetOption(_options_, `"localeMatcher"`, `"string"`, « `"lookup"`, `"best fit"` », `"best fit"`).
1. Set _opt_.[[localeMatcher]] to _matcher_.
1. Let _hour12_ be ? GetOption(_options_, `"hour12"`, `"boolean"`, *undefined*, *undefined*).
1. Let _hourCycle_ be ? GetOption(_options_, `"hourCycle"`, `"string"`, « `"h11"`, `"h12"`, `"h23"`, `"h24"` », *undefined*).
1. If _hour12_ is not *undefined*, then
1. Let _hourCycle_ be *null*.
1. Set _opt_.[[hc]] to _hourCycle_.
1. Let _localeData_ be %DateTimeFormat%.[[LocaleData]].
1. Let _r_ be ResolveLocale( %DateTimeFormat%.[[AvailableLocales]], _requestedLocales_, _opt_, %DateTimeFormat%.[[RelevantExtensionKeys]], _localeData_).
1. Set _dateTimeFormat_.[[Locale]] to _r_.[[locale]].
1. Set _dateTimeFormat_.[[Calendar]] to _r_.[[ca]].
1. <del>Set _dateTimeFormat_.[[HourCycle]] to _r_.[[hc]].</del>
1. <ins>Let _dataLocale_ be _r_.[[dataLocale]].</ins>
1. <ins>Let _dataLocaleData_ be _localeData_.[[<_dataLocale_>]].</ins>
1. <ins>Let _hcDefault_ be _dataLocaleData_.[[hourCycle]].</ins>
1. <ins>Let _hc_ be _r_.[[hc]].</ins>
1. <ins>If _hc_ is *null*, then</ins>
1. <ins>Set _hc_ to _hcDefault_.</ins>
1. <ins>If _hour12_ is not *undefined*, then</ins>
1. <ins>If _hour12_ is *true*, then</ins>
1. <ins>If _hcDefault_ is `"h11"` or `"h23"`, then</ins>
1. <ins>Set _hc_ to `"h11"`.</ins>
1. <ins>Else,</ins>
1. <ins>Set _hc_ to `"h12"`.</ins>
1. <ins>Else,</ins>
1. <ins>Assert: _hour12_ is *false*.</ins>
1. <ins>If _hcDefault_ is `"h11"` or `"h23"`, then</ins>
1. <ins>Set _hc_ to `"h23"`.</ins>
1. <ins>Else,</ins>
1. <ins>Set _hc_ to `"h24"`.</ins>
1. Set _dateTimeFormat_.[[NumberingSystem]] to _r_.[[nu]].
1. <del>Let _dataLocale_ be _r_.[[dataLocale]].</del>
1. Let _timeZone_ be ? Get(_options_, `"timeZone"`).
1. If _timeZone_ is not *undefined*, then
1. Let _timeZone_ be ? ToString(_timeZone_).
1. If the result of IsValidTimeZoneName(_timeZone_) is *false*, then
1. Throw a *RangeError* exception.
1. Let _timeZone_ be CanonicalizeTimeZoneName(_timeZone_).
1. Else,
1. Let _timeZone_ be DefaultTimeZone().
1. Set _dateTimeFormat_.[[TimeZone]] to _timeZone_.
1. <del>Let _dataLocaleData_ be _localeData_.[[<_dataLocale_>]].</del>
1. Let _formats_ be _dataLocaleData_.[[formats]].
1. <ins>Let _dateStyle_ be ? GetOption(_options_, `"dateStyle"`, `"string"`, « `"full"`, `"long"`, `"medium"`, `"short"` », *undefined*).</ins>
1. <ins>If _dateStyle_ is not *undefined*, set _dateTimeFormat_.[[DateStyle]] to _dateStyle_.</ins>
1. <ins>Let _timeStyle_ be ? GetOption(_options_, `"timeStyle"`, `"string"`, « `"full"`, `"long"`, `"medium"`, `"short"` », *undefined*).</ins>
1. <ins>If _timeStyle_ is not *undefined*, then</ins>
1. <ins>Set _dateTimeFormat_.[[TimeStyle]] to _timeStyle_.</ins>
1. <ins>Set _dateTimeFormat_.[[HourCycle]] to _hc_.</ins>
1. <ins>If _dateStyle_ or _timeStyle_ are not *undefined*, then</ins>
1. <ins>Let _pattern_ be DateTimeStylePattern(_dateStyle_, _timeStyle_, _dataLocaleData_, _hc_).</ins>
1. <ins>Else,</ins>
1. Let _opt_ be a new Record.
1. For each row of <emu-xref href="#table-datetimeformat-components"></emu-xref>, except the header row, do
1. Let _prop_ be the name given in the Property column of the row.
1. Let _value_ be ? GetOption(_options_, _prop_, `"string"`, « the strings given in the Values column of the row », *undefined*).
1. Set _opt_.[[<_prop_>]] to _value_.
1. Let _matcher_ be ? GetOption(_options_, `"formatMatcher"`, `"string"`, « `"basic"`, `"best fit"` », `"best fit"`).
1. If _matcher_ is `"basic"`, then
1. Let _bestFormat_ be BasicFormatMatcher(_opt_, _formats_).
1. Else,
1. Let _bestFormat_ be BestFitFormatMatcher(_opt_, _formats_).
1. For each row in <emu-xref href="#table-datetimeformat-components"></emu-xref>, except the header row, do
1. Let _prop_ be the name given in the Property column of the row.
1. Let _p_ be _bestFormat_.[[<_prop_>]].
1. If _p_ not *undefined*, then
1. Set _dateTimeFormat_'s internal slot whose name is the Internal Slot column of the row to _p_.
1. If _dateTimeFormat_.[[Hour]] is not *undefined*, then
1. <del>Let _hcDefault_ be _dataLocaleData_.[[hourCycle]].</del>
1. <del>Let _hc_ be _dateTimeFormat_.[[HourCycle]].</del>
1. <del>If _hc_ is *null*, then</del>
1. <del>Set _hc_ to _hcDefault_.</del>
1. <del>If _hour12_ is not *undefined*, then</del>
1. <del>If _hour12_ is *true*, then</del>
1. <del>If _hcDefault_ is `"h11"` or `"h23"`, then</del>
1. <del>Set _hc_ to `"h11"`.</del>
1. <del>Else,</del>
1. <del>Set _hc_ to `"h12"`.</del>
1. <del>Else,</del>
1. <del>Assert: _hour12_ is *false*.</del>
1. <del>If _hcDefault_ is `"h11"` or `"h23"`, then</del>
1. <del>Set _hc_ to `"h23"`.</del>
1. <del>Else,</del>
1. <del>Set _hc_ to `"h24"`.</del>
1. Set _dateTimeFormat_.[[HourCycle]] to _hc_.
1. If _dateTimeformat_.[[HourCycle]] is `"h11"` or `"h12"`, then
1. Let _pattern_ be _bestFormat_.[[pattern12]].
1. Else,
1. Let _pattern_ be _bestFormat_.[[pattern]].
1. Else,
1. Set _dateTimeFormat_.[[HourCycle]] to *undefined*.
1. Let _pattern_ be _bestFormat_.[[pattern]].
1. Set _dateTimeFormat_.[[Pattern]] to _pattern_.
1. Return _dateTimeFormat_.
</emu-alg>
</emu-clause>
<emu-clause id="sec-date-time-style-pattern" aoid="DateTimeStylePattern">
<h1><ins>DateTimeStylePattern ( _dateStyle_, _timeStyle_, _dataLocaleData_, _hourCycle_ )</ins></h1>
<p>The DateTimeStylePattern abstract operation accepts arguments _dateStyle_ and _timeStyle_, which are each either *undefined*, `"full"`, `"long"`, `"medium"`, or `"short"`, at least one of which is not *undefined*, _dataLocaleData_, which is a record from %DateTimeFormat%.[[LocaleData]][_locale_] for some locale _locale_, and _hourCycle_, which is either `"h11"`, `"h12"`, `"h23"`, or `"h24"`. It returns the appropriate pattern for date time formatting based on the parameters.</p>
<emu-alg>
1. If _timeStyle_ is not *undefined*,
1. Assert: _timeStyle_ is one of `"full"`, `"long"`, `"medium"`, or `"short"`.
1. Let _timeFormats_ be _dataLocaleData_.[[TimeFormat]].[[<_timeStyle_>]].
1. If _hourCycle_ is `"h11"` or `"h12"`, then
1. Let _timeFormat_ be _timeFormats_.[[pattern12]].
1. Else,
1. Let _timeFormat_ be _timeFormats_.[[pattern]].
1. If _dateStyle_ is not *undefined*,
1. Assert: _dateStyle_ is one of `"full"`, `"long"`, `"medium"`, or `"short"`.
1. Let _dateFormat_ be _dataLocaleData_.[[DateFormat]].[[<_dateStyle_>]].
1. If _dateStyle_ is not *undefined* and _timeStyle_ is not *undefined*,
1. Let _connector_ be _dataLocaleData_.[[DateTimeFormat]].[[<_dateStyle_>]].
1. Return the string _connector_ with the substring `"{0}"` replaced with _timeFormat_ and the substring `"{1}"` replaced with _dateFormat_.
1. If _timeStyle_ is not *undefined*, then
1. Return _timeFormat_.
1. Assert: _dateStyle_ is not *undefined*.
1. Return _dateFormat_.
</emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-intl-datetimeformat-constructor">
<h1>The Intl.DateTimeFormat Constructor</h1>
<p>
The Intl.DateTimeFormat constructor is the <dfn>%DateTimeFormat%</dfn> intrinsic object and a standard built-in property of the Intl object. Behaviour common to all service constructor properties of the Intl object is specified in <emu-xref href="#sec-internal-slots"></emu-xref>.
</p>
<emu-clause id="sec-intl.datetimeformat">
<h1>Intl.DateTimeFormat ( [ _locales_ [ , _options_ ] ] )</h1>
<p>
When the `Intl.DateTimeFormat` function is called with optional arguments _locales_ and _options_, the following steps are taken:
</p>
<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_, `"%DateTimeFormatPrototype%"`, « [[InitializedDateTimeFormat]], [[Locale]], [[Calendar]], [[NumberingSystem]], [[TimeZone]], [[Weekday]], [[Era]], [[Year]], [[Month]], [[Day]], [[Hour]], [[Minute]], [[Second]], [[TimeZoneName]], [[HourCycle]], <ins>[[DateStyle]], [[TimeStyle]],</ins> [[Pattern]], [[BoundFormat]] »).
1. Perform ? InitializeDateTimeFormat(_dateTimeFormat_, _locales_, _options_).
</emu-alg>
<emu-normative-optional>
<emu-alg>
4. Let _this_ be the *this* value.
1. If NewTarget is *undefined* and ? InstanceofOperator(_this_, %DateTimeFormat%), then
1. Perform ? DefinePropertyOrThrow(_this_, Intl.[[FallbackSymbol]], { [[Value]]: _dateTimeFormat_, [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }).
1. Return _this_.
</emu-alg>
</emu-normative-optional>
<emu-alg>
6. Return _dateTimeFormat_.
</emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-properties-of-intl-datetimeformat-constructor">
<h1>Properties of the Intl.DateTimeFormat Constructor</h1>
<emu-clause id="sec-intl.datetimeformat-internal-slots">
<h1>Internal slots</h1>
<p>
The value of the [[AvailableLocales]] internal slot is implementation defined within the constraints described in <emu-xref href="#sec-internal-slots"></emu-xref>.
</p>
<p>
The value of the [[RelevantExtensionKeys]] internal slot is « `"ca"`, `"nu"`, `"hc"` ».
</p>
<emu-note>
Unicode Technical Standard 35 describes three locale extension keys that are relevant to date and time formatting, `"ca"` for calendar, `"tz"` for time zone, `"hc"` for hour cycle, and implicitly `"nu"` for the numbering system of the number format used for numbers within the date format. DateTimeFormat, however, requires that the time zone is specified through the timeZone property in the options objects.
</emu-note>
<p>
The value of the [[LocaleData]] internal slot is implementation defined within the constraints described in <emu-xref href="#sec-internal-slots"></emu-xref> and the following additional constraints:
</p>
<ul>
<li>
The list that is the value of the `"nu"` field of any locale field of [[LocaleData]] must not include the values `"native"`, `"traditio"`, or `"finance"`.
</li>
<li>
[[LocaleData]][locale].hc must be « *null*, `"h11"`, `"h12"`, `"h23"`, `"h24"` » for all locale values.
</li>
<li>
[[LocaleData]][locale] must have a hourCycle field with a String value equal to `"h11"`, `"h12"`, `"h23"`, or `"h24"` for all locale values.
</li>
<li>
[[LocaleData]][locale] must have a formats field for all locale values. The value of this field must be a list of records, each of which has a subset of the fields shown in <emu-xref href="#table-datetimeformat-components"></emu-xref>, where each field must have one of the values specified for the field in <emu-xref href="#table-datetimeformat-components"></emu-xref>. Multiple records in a list may use the same subset of the fields as long as they have different values for the fields. The following subsets must be available for each locale:
<ul>
<li>weekday, year, month, day, hour, minute, second</li>
<li>weekday, year, month, day</li>
<li>year, month, day</li>
<li>year, month</li>
<li>month, day</li>
<li>hour, minute, second</li>
<li>hour, minute</li>
</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}"`.
</li>
<li>
<ins>
[[LocaleData]][locale] must contain [[DateFormat]], [[TimeFormat]] and [[DateTimeFormat]] fields, each of which has [[full]], [[long]], [[medium]] and [[short]] fields. These fields have string pattern values for [[DateFormat]] and [[DateTimeFormat]]; for [[TimeFormat]], they are records with [[pattern]] and [[pattern12]] fields, which are string patterns.
</ins>
</li>
</ul>
<p>
EXAMPLE An implementation might include the following record as part of its English locale data: {[[Hour]]: `"numeric"`, [[Minute]]: `"2-digit"`, [[Second]]: `"2-digit"`, [[Pattern]]: `"{hour}:{minute}:{second}"`, [[Pattern12]]: `"{hour}:{minute}:{second} {ampm}"`}.
</p>
<emu-note>
It is recommended that implementations use the locale data provided by the Common Locale Data Repository (available at <a href="http://cldr.unicode.org/">http://cldr.unicode.org/</a>).
</emu-note>
</emu-clause>
</emu-clause>
<emu-clause id="sec-properties-of-intl-datetimeformat-prototype-object">
<h1>Properties of the Intl.DateTimeFormat Prototype Object</h1>
<emu-clause id="sec-intl.datetimeformat.prototype.resolvedoptions">
<h1>Intl.DateTimeFormat.prototype.resolvedOptions ()</h1>
<p>
This function provides access to the locale and formatting options computed during initialization of the object.
</p>
<emu-alg>
1. Let _dtf_ be *this* value.
1. If Type(_dtf_) is not Object, throw a *TypeError* exception.
1. Let _dtf_ be ? UnwrapDateTimeFormat(_dtf_).
1. Let _options_ be ! ObjectCreate(%ObjectPrototype%).
1. For each row of <emu-xref href="#table-datetimeformat-resolvedoptions-properties"></emu-xref>, except the header row, in table order, do
1. Let _p_ be the Property value of the current row.
1. If _p_ is `"hour12"`, then
1. Let _hc_ be _dtf_.[[HourCycle]].
1. If _hc_ is `"h11"` or `"h12"`, let _v_ be *true*.
1. Else if, _hc_ is `"h23"` or `"h24"`, let _v_ be *false*.
1. Else, let _v_ be *undefined*.
1. Else,
1. Let _v_ be the value of _dtf_'s internal slot whose name is the Internal Slot value of the current row.
1. If _v_ is not *undefined*, then
1. Perform ! CreateDataPropertyOrThrow(_options_, _p_, _v_).
1. Return _options_.
</emu-alg>
<emu-table id="table-datetimeformat-resolvedoptions-properties">
<emu-caption>Resolved Options of DateTimeFormat Instances</emu-caption>
<table class="real-table">
<thead>
<tr>
<th>Internal Slot</th>
<th>Property</th>
</tr>
</thead>
<tr>
<td>[[Locale]]</td>
<td>`"locale"`</td>
</tr>
<tr>
<td>[[Calendar]]</td>
<td>`"calendar"`</td>
</tr>
<tr>
<td>[[NumberingSystem]]</td>
<td>`"numberingSystem"`</td>
</tr>
<tr>
<td>[[TimeZone]]</td>
<td>`"timeZone"`</td>
</tr>
<tr>
<td>[[HourCycle]]</td>
<td>`"hourCycle"`</td>
</tr>
<tr>
<td></td>
<td>`"hour12"`</td>
</tr>
<tr>
<td>[[Weekday]]</td>
<td>`"weekday"`</td>
</tr>
<tr>
<td>[[Era]]</td>
<td>`"era"`</td>
</tr>
<tr>
<td>[[Year]]</td>
<td>`"year"`</td>
</tr>
<tr>
<td>[[Month]]</td>
<td>`"month"`</td>
</tr>
<tr>
<td>[[Day]]</td>
<td>`"day"`</td>
</tr>
<tr>
<td>[[Hour]]</td>
<td>`"hour"`</td>
</tr>
<tr>
<td>[[Minute]]</td>
<td>`"minute"`</td>
</tr>
<tr>
<td>[[Second]]</td>
<td>`"second"`</td>
</tr>
<tr>
<td>[[TimeZoneName]]</td>
<td>`"timeZoneName"`</td>
</tr>
<tr>
<td><ins>[[DateStyle]]</ins></td>
<td><ins>`"dateStyle"`</ins></td>
</tr>
<tr>
<td><ins>[[TimeStyle]]</ins></td>
<td><ins>`"timeStyle"`</ins></td>
</tr>
</table>
</emu-table>
<p>
For web compatibility reasons, if the property hourCycle is set, the hour12 property should be set to *true* when hourCycle is `"h11"` or `"h12"`, or to *false* when hourCycle is `"h23"` or `"h24"`.
</p>
<emu-note>
In this version of the ECMAScript 2020 Internationalization API, the timeZone property will be the name of the default time zone if no timeZone property was provided in the options object provided to the Intl.DateTimeFormat constructor. The first edition left the timeZone property *undefined* in this case.
</emu-note>
<emu-note>
For compatibility with versions prior to the fifth edition, the `"hour12"` property is set in addition to the `"hourCycle"` property.
</emu-note>
</emu-clause>
</emu-clause>
<emu-clause id="sec-properties-of-intl-datetimeformat-instances">
<h1>Properties of Intl.DateTimeFormat Instances</h1>
<p>
Intl.DateTimeFormat instances inherit properties from %DateTimeFormatPrototype%.
</p>
<p>
Intl.DateTimeFormat instances have an [[InitializedDateTimeFormat]] internal slot.
</p>
<p>
Intl.DateTimeFormat instances also have several internal slots that are computed by the constructor:
</p>
<ul>
<li>[[Locale]] is a String value with the language tag of the locale whose localization is used for formatting.</li>
<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>[[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 <del>[[Hour]] is not *undefined*</del><ins>[[Pattern]] includes the hour</ins>.</li>
<li><ins>[[DateStyle]], [[TimeStyle]] are each either *undefined*, or a String value with values `"full"`, `"long"`, `"medium"`, or `"short"`.</ins></li>
<li>[[Pattern]] is a String value as described in <emu-xref href="#sec-intl.datetimeformat-internal-slots"></emu-xref>.</li>
</ul>
</emu-clause>
</emu-clause>