-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathspec.emu
More file actions
1639 lines (1584 loc) · 82.9 KB
/
Copy pathspec.emu
File metadata and controls
1639 lines (1584 loc) · 82.9 KB
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
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<meta charset="utf8">
<pre class="metadata">
title: Intl era and monthCode Proposal
stage: 4
location: https://tc39.es/proposal-intl-era-monthcode/
copyright: true
contributors: Google, Ecma International
</pre>
<emu-biblio href="biblio.json"></emu-biblio>
<emu-clause id="ecma402-locales-currencies-tz">
<h1>Identification of Locales, Currencies, Time Zones, Measurement Units, Numbering Systems, Collations, and Calendars</h1>
<emu-clause id="sec-ecma402-calendar-types" oldids="sec-calendar-types">
<h1>Calendar Types</h1>
<emu-note type="editor">
<p>
This section, Calendar Types, is <a href="https://tc39.es/ecma402/#sec-calendar-types">present in ECMA-402</a> but is slated to <a href="https://tc39.es/proposal-temporal/#sec-calendar-types">move to ECMA-262 as part of the Temporal proposal</a>.
This proposal re-adds the section to ECMA-402, but with additional requirements for Intl-supporting implementations, beyond those specified in ECMA-262.
</p>
</emu-note>
<del class="block">
<p>This specification identifies calendars using a <dfn variants="calendar types">calendar type</dfn> as defined by <a href="https://unicode.org/reports/tr35/tr35-dates.html#Calendar_Elements">Unicode Technical Standard #35 Part 4 Dates, Section 2 Calendar Elements</a>. Their canonical form is a string containing only Unicode Basic Latin lowercase letters (U+0061 LATIN SMALL LETTER A through U+007A LATIN SMALL LETTER Z) with zero or more medial hyphens (U+002D HYPHEN-MINUS).</p>
</del>
<ins class="block">
<p>
ECMA-262 describes calendar types, of which *"iso8601"* is required to be supported.
This specification additionally requires ECMAScript implementations to support calendar types corresponding with those of the <a href="https://cldr.unicode.org/">Unicode Common Locale Data Repository (CLDR)</a>.
</p>
<p>
The following table lists the calendar types described in CLDR, along with implementation notes and sources where necessary.
All calendar types must use a <dfn>proleptic</dfn> reckoning, meaning that the current rules for calendrical calculations are extended indefinitely into the past, ignoring dates when historical calendar reforms happened.
</p>
<p>
For example, at various points from the 16th to the 20th century, various locales in Europe changed from the Julian to the Gregorian calendar, skipping some dates in the process.
Since the *"gregory"* calendar is proleptic, no dates are skipped; all dates are in the "new system," even if it wasn't used at the time.
</p>
<emu-table id="table-calendar-types">
<emu-caption>Calendar types described in CLDR</emu-caption>
<table class="real-table">
<thead>
<tr>
<th>Calendar Type</th>
<th>Description and implementation notes</th>
</tr>
</thead>
<tr>
<td>*"buddhist"*</td>
<td><a href="https://en.wikipedia.org/wiki/Thai_solar_calendar">Thai Buddhist calendar</a>. Month numbers, month codes, and days are identical to ISO 8601, with one era and an epoch year differing from the epoch year in *"gregory"*. All years are treated as having 12 months. For compatibility with other systems, dates prior to ISO year 1941 (2484 BE) are defined but may not correspond to historically accurate values due to the calendar reforms of 1940 and earlier.</td>
</tr>
<tr>
<td>*"chinese"*</td>
<td>Traditional <a href="https://en.wikipedia.org/wiki/Chinese_calendar">Chinese calendar</a>. Lunisolar calendar, based on <a href="https://pmo.cas.cn/xwdt2019/kpdt2019/202203/t20220309_6386774.html">data published by the Purple Mountain Observatory</a> for dates between 1900 and 2100 (which complies with <a href="https://openstd.samr.gov.cn/bzgk/gb/newGbInfo?hcno=E107EA4DE9725EDF819F33C60A44B296">GB/T 33661-2017, Calculation and Promulgation of the Chinese Calendar</a>), falling back to an implementation-defined approximation outside that range. The arithmetic year is as in *"gregory"*, and there are no eras.</td>
</tr>
<tr>
<td>*"coptic"*</td>
<td><a href="https://en.wikipedia.org/wiki/Coptic_calendar">Coptic calendar</a>. Similar solar algorithm to *"ethioaa"* and *"ethiopic"* but with a different epoch year. There is one era, starting in the epoch year.</td>
</tr>
<tr>
<td>*"dangi"*</td>
<td>Traditional <a href="https://en.wikipedia.org/wiki/Korean_calendar">Korean calendar</a>. Lunisolar calendar, based on <a href="https://astro.kasi.re.kr/life/post/calendardata"> data published by the Korea Astronomy and Space Science Institute (KASI)</a> for dates between 1900 and 2050, falling back to an implementation-defined approximation outside that range. The arithmetic year is as in *"gregory"*, and there are no eras.</td>
</tr>
<tr>
<td>*"ethioaa"*</td>
<td><a href="https://en.wikipedia.org/wiki/Ethiopian_calendar">Ethiopian calendar</a>, Amete Alem era. Similar solar algorithm to *"coptic"* and *"ethiopic"*, but with a different epoch year. There is one era, starting in the epoch year.</td>
</tr>
<tr>
<td>*"ethiopic"*</td>
<td><a href="https://en.wikipedia.org/wiki/Ethiopian_calendar">Ethiopian calendar</a>, Amete Mihret era. Similar solar algorithm to *"coptic"* and *"ethioaa"*, but with a different epoch year. There are two eras, one starting in the epoch year of *"ethioaa"* and one starting in this calendar's epoch year.</td>
</tr>
<tr>
<td>*"ethiopic-amete-alem"*</td>
<td>Alias for *"ethioaa"*.</td>
</tr>
<tr>
<td>*"gregory"*</td>
<td><a href="https://en.wikipedia.org/wiki/Gregorian_calendar">Gregorian calendar</a>. Solar calendar almost identical to the ISO 8601 calendar, except that it does not define week numbering and it contains two eras, one before the epoch year and one after.</td>
</tr>
<tr>
<td>*"hebrew"*</td>
<td><a href="https://en.wikipedia.org/wiki/Hebrew_calendar">Hebrew calendar</a>. Civil calendar with Tishrei as the first month of the year. Lunisolar calendar with one leap month inserted after month 5. There is one era.</td>
</tr>
<tr>
<td>*"indian"*</td>
<td><a href="https://en.wikipedia.org/wiki/Indian_national_calendar">Indian national</a> (or Śaka) calendar. Solar calendar with one era.</td>
</tr>
<tr>
<td>*"islamic-civil"*</td>
<td><a href="https://en.wikipedia.org/wiki/Tabular_Islamic_calendar">Tabular Hijri calendar</a> with leap years 2, 5, 7, 10, 13, 16, 18, 21, 24, 26, 29 in the 30-year cycle, and civil epoch (Friday July 16, 622 Julian / 0622-07-19 ISO)</td>
</tr>
<tr>
<td>*"islamic-tbla"*</td>
<td><a href="https://en.wikipedia.org/wiki/Tabular_Islamic_calendar">Tabular Hijri calendar</a> with leap years 2, 5, 7, 10, 13, 16, 18, 21, 24, 26, 29 in the 30-year cycle, and astronomical epoch (Thursday July 15, 622 Julian / 0622-07-18 ISO)</td>
</tr>
<tr>
<td>*"islamic-umalqura"*</td>
<td><a href="https://en.wikipedia.org/wiki/Islamic_calendar">Hijri calendar</a>, Umm al-Qura. Lunar calendar using months calculated by King Abdulaziz City for Science and Technology (KACST) for dates from the start of 1300 AH to the end of 1600 AH, falling back to *"islamic-civil"* outside that range.</td>
</tr>
<tr>
<td>*"islamicc"*</td>
<td>Alias for *"islamic-civil"*.</td>
</tr>
<tr>
<td>*"iso8601"*</td>
<td><a href="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> calendar. Fully specified in ECMA-262.</td>
</tr>
<tr>
<td>*"japanese"*</td>
<td><a href="https://en.wikipedia.org/wiki/Japanese_calendar">Japanese Imperial calendar</a>, era system hybridised with the era system used in *"gregory"*. Month numbers, month codes, and days are the same as in the ISO 8601 calendar. For dates up to and including 1872-12-31, years and eras identical to *"gregory"* are used. For later dates, the eras and ranges defined by the Japanese government are used. Note that ISO year 1873 is the 6th year of the Meiji period, starting on ISO date 1868-10-23, during which calendar reforms took place. The arithmetic year is identical to *"gregory"*.</td>
</tr>
<tr>
<td>*"persian"*</td>
<td><a href="https://en.wikipedia.org/wiki/Solar_Hijri_calendar">Persian (or Solar Hijri) calendar</a>. There is one era. Solar calendar using leap years as <a href="https://calendar.ut.ac.ir/documents/2139738/7092644/Kabise+Shamsi+1206-1498.pdf">published by the Iranian calendar authority</a> for dates between 1206 AP and 1498 AP, falling back to an implementation-defined approximation outside that range.</td>
</tr>
<tr>
<td>*"roc"*</td>
<td><a href="https://en.wikipedia.org/wiki/Republic_of_China_calendar">Republic of China (or Minguo) calendar</a>. Month numbers, month codes, and days are the same as in the ISO 8601 calendar, with two eras, one before the epoch year and one after. The epoch year is different from *"gregory"*.</td>
</tr>
</table>
</emu-table>
</ins>
<emu-clause id="sup-availablecalendars" oldids="sec-availablecalendars sec-availablecanonicalcalendars" type="abstract operation">
<h1>AvailableCalendars ( ): a List of calendar types</h1>
<dl class="header">
<dt>description</dt>
<dd>The returned List is sorted according to lexicographic code unit order, and contains unique calendar types in canonical form (<emu-xref href="#sec-calendar-types"></emu-xref>) identifying the calendars for which the implementation provides the functionality of Intl.DateTimeFormat objects, including their aliases (e.g., <del>either</del> both <del>or neither of</del> *"islamicc"* and *"islamic-civil"*). The List must consist of <del>*"iso8601"*</del><ins>the "Calendar Type" value of every row of <emu-xref href="#table-calendar-types"></emu-xref>, except the header row</ins>.</dd>
</dl>
</emu-clause>
</emu-clause>
</emu-clause>
<emu-clause id="locale-and-parameter-negotiation">
<h1>Locale and Parameter Negotiation</h1>
<emu-clause id="sec-internal-slots">
<h1>Internal slots of Service Constructors</h1>
<p>[...]</p>
<emu-note>
For example, an implementation of DateTimeFormat might include the language tag *"fa-IR"* in its [[AvailableLocales]] internal slot, and must (according to <emu-xref href="#sec-intl.datetimeformat-internal-slots"></emu-xref>) include the keys *"ca"*, *"hc"*, and *"nu"* in its [[RelevantExtensionKeys]] internal slot.
The default calendar for that locale is usually *"persian"*, but an implementation might also support *"gregory"*<del>, *"islamic"*,</del> and *"islamic-civil"*.
The Record in the DateTimeFormat [[LocaleData]] internal slot would therefore include a [[fa-IR]] field whose value is a Record like { [[ca]]: « *"persian"*, *"gregory"*, <del>*"islamic"*,</del> *"islamic-civil"* », [[hc]]: « … », [[nu]]: « … » }, along with other locale-named fields having the same value shape but different elements in their Lists.
</emu-note>
</emu-clause>
</emu-clause>
<emu-clause id="ecma402-datetimeformat-objects">
<h1>DateTimeFormat Objects</h1>
<emu-clause id="sec-ecma402-intl-datetimeformat-constructor">
<h1>The Intl.DateTimeFormat Constructor</h1>
<emu-clause id="sec-createdatetimeformat" type="abstract operation" oldids="sec-initializedatetimeformat,sec-todatetimeoptions">
<h1>
CreateDateTimeFormat (
_newTarget_: a constructor,
_locales_: an ECMAScript language value,
_options_: an ECMAScript language value,
_required_: ~date~, ~time~, or ~any~,
_defaults_: ~date~, ~time~, or ~all~,
): either a normal completion containing a DateTimeFormat object or a throw completion
</h1>
<dl class="header">
</dl>
<emu-alg>
1. Let _dateTimeFormat_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Intl.DateTimeFormat.prototype%"*, « [[InitializedDateTimeFormat]], [[Locale]], [[Calendar]], [[NumberingSystem]], [[TimeZone]], [[HourCycle]], [[DateStyle]], [[TimeStyle]], [[DateTimeFormat]], [[BoundFormat]] »).
1. Let _hour12_ be *undefined*.
1. Let _modifyResolutionOptions_ be a new Abstract Closure with parameters (_options_) that captures _hour12_ and performs the following steps when called:
1. Set _hour12_ to _options_.[[hour12]].
1. Remove field [[hour12]] from _options_.
1. If _hour12_ is not *undefined*, set _options_.[[hc]] to *null*.
1. Let _optionsResolution_ be ? ResolveOptions(%Intl.DateTimeFormat%, %Intl.DateTimeFormat%.[[LocaleData]], _locales_, _options_, « ~coerce-options~ », _modifyResolutionOptions_).
1. Set _options_ to _optionsResolution_.[[Options]].
1. Let _r_ be _optionsResolution_.[[ResolvedLocale]].
1. Set _dateTimeFormat_.[[Locale]] to _r_.[[Locale]].
1. Let _resolvedCalendar_ be _r_.[[ca]].
1. <ins>If _resolvedCalendar_ is *"islamic"*, then</ins>
1. <ins>Set _resolvedCalendar_ to *"islamic-tbla"*.</ins>
1. <ins>If the ECMAScript implementation has a mechanism for reporting diagnostic warning messages, a warning should be issued.</ins>
1. Set _dateTimeFormat_.[[Calendar]] to _resolvedCalendar_.
1. NOTE: Rest of algorithm unchanged.
</emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-ecma402-properties-of-intl-datetimeformat-constructor">
<h1>Properties of the Intl.DateTimeFormat Constructor</h1>
<emu-clause id="sec-ecma402-intl.datetimeformat-internal-slots">
<h1>Internal slots</h1>
<p>[...]</p>
<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, for all locale values _locale_:</p>
<ul>
<li><ins>[[LocaleData]].[[<_locale_>]].[[ca]] must be a List consisting of calendar types. It may include calendar types not listed in <emu-xref href="#table-calendar-types"></emu-xref>.</ins></li>
<li>
[[LocaleData]].[[<_locale_>]].[[nu]] must be a List that does not include the values *"native"*, *"traditio"*, or *"finance"*.
</li>
<li>
[[LocaleData]].[[<_locale_>]].[[hc]] must be « *null*, *"h11"*, *"h12"*, *"h23"*, *"h24"* ».
</li>
<li>[...]</li>
</ul>
</emu-clause>
</emu-clause>
</emu-clause>
<emu-clause id="ecma402-locale-sensitive-functions">
<h1>Locale Sensitive Functions of the ECMAScript Language Specification</h1>
<emu-clause id="sec-calendar-abstract-ops">
<h1>Abstract Operations for Calendar Calculations</h1>
<emu-clause id="sec-temporal-calendarsupportsera" type="abstract operation">
<h1>
CalendarSupportsEra (
_calendar_: a calendar type,
): a Boolean
</h1>
<dl class="header">
<dt>description</dt>
<dd>
The following algorithm refers (via <emu-xref href="#table-eras"></emu-xref>) to the era data from <a href="https://unicode.org/reports/tr35/tr35-dates.html#Calendar_Data">Unicode Technical Standard #35 Part 4 Dates, Calendar Data</a>.
</dd>
</dl>
<emu-alg>
1. If _calendar_ is listed in the "Calendar" column of <emu-xref href="#table-eras"></emu-xref>, return *true*.
1. If _calendar_ is listed in the "Calendar Type" column of <emu-xref href="#table-calendar-types"></emu-xref>, return *false*.
1. Return an implementation-defined value.
</emu-alg>
<p>
<emu-xref href="#table-eras"></emu-xref> lists all currently known eras for the current set of calendars, including their aliases, ranges, and kinds.
The canonical source for this table is the data described in <a href="https://unicode.org/reports/tr35/tr35-dates.html#Calendar_Data">Unicode Technical Standard #35 Part 4 Dates, Calendar Data</a>.
</p>
<p>The era kind is used by <emu-xref href="#sec-temporal-calendardatearithmeticyearforerayear">CalendarDateArithmeticYearForEraYear</emu-xref> to calculate the arithmetic year ([[Year]]):
An *Era Kind* ~epoch~ means that the era is the epoch era, so 1 Era has an arithmetic year of 1. An *Era Kind* ~negative~ means that the era is a "negative" era growing
from the epoch, so 1 Era is an arithmetic year of 0, and larger [[EraYear]] values produce smaller, negative arithmetic years. An *Era Kind* of
~offset~ means that the era is "offset" by a given number (in the *Offset* column), so 1 Era has an arithmetic year of *Offset*.</p>
<emu-table id="table-eras">
<emu-caption>Eras</emu-caption>
<table class="real-table">
<thead>
<tr>
<th>Calendar</th>
<th>Era</th>
<th>Aliases</th>
<th>Minimum eraYear</th>
<th>Maximum eraYear</th>
<th>Era Kind</th>
<th>Offset</th>
</tr>
</thead>
<tr>
<td>*"buddhist"*</td>
<td>*"be"*</td>
<td></td>
<td>-∞</td>
<td>+∞</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"coptic"*</td>
<td>*"am"*</td>
<td></td>
<td>-∞</td>
<td>+∞</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"ethioaa"*</td>
<td>*"aa"*</td>
<td></td>
<td>-∞</td>
<td>+∞</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"ethiopic"*</td>
<td>*"am"*</td>
<td></td>
<td>1</td>
<td>+∞</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"ethiopic"*</td>
<td>*"aa"*</td>
<td></td>
<td>-∞</td>
<td>5500</td>
<td> ~offset~</td>
<td>-5499</td>
</tr>
<tr>
<td>*"gregory"*</td>
<td>*"ce"*</td>
<td>*"ad"*</td>
<td>1</td>
<td>+∞</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"gregory"*</td>
<td>*"bce"*</td>
<td>*"bc"*</td>
<td>1</td>
<td>+∞</td>
<td>~negative~</td>
<td></td>
</tr>
<tr>
<td>*"hebrew"*</td>
<td>*"am"*</td>
<td></td>
<td>-∞</td>
<td>+∞</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"indian"*</td>
<td>*"shaka"*</td>
<td></td>
<td>-∞</td>
<td>+∞</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"islamic-civil"*</td>
<td>*"ah"*</td>
<td></td>
<td>1</td>
<td>+∞</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"islamic-civil"*</td>
<td>*"bh"*</td>
<td></td>
<td>1</td>
<td>+∞</td>
<td>~negative~</td>
<td></td>
</tr>
<tr>
<td>*"islamic-tbla"*</td>
<td>*"ah"*</td>
<td></td>
<td>1</td>
<td>+∞</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"islamic-tbla"*</td>
<td>*"bh"*</td>
<td></td>
<td>1</td>
<td>+∞</td>
<td>~negative~</td>
<td></td>
</tr>
<tr>
<td>*"islamic-umalqura"*</td>
<td>*"ah"*</td>
<td></td>
<td>1</td>
<td>+∞</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"islamic-umalqura"*</td>
<td>*"bh"*</td>
<td></td>
<td>1</td>
<td>+∞</td>
<td>~negative~</td>
<td></td>
</tr>
<tr>
<td>*"japanese"*</td>
<td>*"reiwa"*</td>
<td></td>
<td>1</td>
<td>+∞</td>
<td>~offset~</td>
<td>2019</td>
</tr>
<tr>
<td>*"japanese"*</td>
<td>*"heisei"*</td>
<td></td>
<td>1</td>
<td>31</td>
<td>~offset~</td>
<td>1989</td>
</tr>
<tr>
<td>*"japanese"*</td>
<td>*"showa"*</td>
<td></td>
<td>1</td>
<td>64</td>
<td>~offset~</td>
<td>1926</td>
</tr>
<tr>
<td>*"japanese"*</td>
<td>*"taisho"*</td>
<td></td>
<td>1</td>
<td>15</td>
<td>~offset~</td>
<td>1912</td>
</tr>
<tr>
<td>*"japanese"*</td>
<td>*"meiji"*</td>
<td></td>
<td>6</td>
<td>45</td>
<td>~offset~</td>
<td>1868</td>
</tr>
<tr>
<td>*"japanese"*</td>
<td>*"ce"*</td>
<td>*"ad"*</td>
<td>1</td>
<td>1872</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"japanese"*</td>
<td>*"bce"*</td>
<td>*"bc"*</td>
<td>1</td>
<td>+∞</td>
<td>~negative~</td>
<td></td>
</tr>
<tr>
<td>*"persian"*</td>
<td>*"ap"*</td>
<td></td>
<td>-∞</td>
<td>+∞</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"roc"*</td>
<td>*"roc"*</td>
<td></td>
<td>1</td>
<td>+∞</td>
<td>~epoch~</td>
<td></td>
</tr>
<tr>
<td>*"roc"*</td>
<td>*"broc"*</td>
<td></td>
<td>1</td>
<td>+∞</td>
<td>~negative~</td>
<td></td>
</tr>
</table>
</emu-table>
</emu-clause>
<emu-clause id="sec-temporal-canonicalizeeraincalendar" type="abstract operation">
<h1>
CanonicalizeEraInCalendar (
_calendar_: a calendar type that is not *"iso8601"*,
_era_: a String,
): a String or *undefined*
</h1>
<dl class="header">
<dt>description</dt>
<dd>
The following algorithm refers to the era data from <a href="https://unicode.org/reports/tr35/tr35-dates.html#Calendar_Data">Unicode Technical Standard #35 Part 4 Dates, Calendar Data</a>.
</dd>
</dl>
<emu-alg>
1. For each row of <emu-xref href="#table-eras"></emu-xref>, except the header row, do
1. Let _cal_ be the Calendar value of the current row.
1. If _cal_ is equal to _calendar_, then
1. Let _canonicalName_ be the Era value of the current row.
1. If _canonicalName_ is equal to _era_, return _canonicalName_.
1. Let _aliases_ be a List whose elements are the strings given in the "Aliases" column of the row.
1. If _aliases_ contains _era_, return _canonicalName_.
1. If _calendar_ is listed in the "Calendar Type" column of <emu-xref href="#table-calendar-types"></emu-xref>, return *undefined*.
1. Return an implementation-defined value.
</emu-alg>
</emu-clause>
<emu-clause id="sec-temporal-calendarhasmidyeareras" type="abstract operation">
<h1>
CalendarHasMidYearEras (
_calendar_: a calendar type that is not *"iso8601"*,
): a Boolean
</h1>
<dl class="header">
<dt>description</dt>
<dd>It returns *true* if the calendar has eras that start in the middle of the year, or *false* if all eras start on a year boundary.</dd>
</dl>
<emu-alg>
1. If _calendar_ is *"japanese"*, return *true*.
1. If _calendar_ is listed in the "Calendar Type" column of <emu-xref href="#table-calendar-types"></emu-xref>, return *false*.
1. Return an implementation-defined value.
</emu-alg>
</emu-clause>
<emu-clause id="sec-temporal-isvalidmonthcodeforcalendar" type="abstract operation">
<h1>
IsValidMonthCodeForCalendar (
_calendar_: a calendar type that is not *"iso8601"*,
_monthCode_: a month code,
): a Boolean
</h1>
<dl class="header">
</dl>
<emu-alg>
1. Let _commonMonthCodes_ be « *"M01"*, *"M02"*, *"M03"*, *"M04"*, *"M05"*, *"M06"*, *"M07"*, *"M08"*, *"M09"*, *"M10"*, *"M11"*, *"M12"* ».
1. If _commonMonthCodes_ contains _monthCode_, return *true*.
1. If _calendar_ is listed in the "Calendar" column of <emu-xref href="#table-additional-month-codes"></emu-xref>, then
1. Let _r_ be the row in <emu-xref href="#table-additional-month-codes"></emu-xref> with a value in the Calendar column matching _calendar_.
1. Let _specialMonthCodes_ be a List whose elements are the strings given in the "Additional Month Codes" column of _r_.
1. If _specialMonthCodes_ contains _monthCode_, return *true*.
1. Return *false*.
1. If _calendar_ is listed in the "Calendar Type" column of <emu-xref href="#table-calendar-types"></emu-xref>, return *false*.
1. Return an implementation-defined value.
</emu-alg>
<emu-table id="table-additional-month-codes">
<emu-caption>Additional Month Codes in Calendars</emu-caption>
<table class="real-table">
<thead>
<tr>
<th>Calendar</th>
<th>Additional Month Codes</th>
<th>Leap to Common Month Transformation</th>
</tr>
</thead>
<tr>
<td>*"chinese"*</td>
<td>*"M01L"*, *"M02L"*, *"M03L"*, *"M04L"*, *"M05L"*, *"M06L"*, *"M07L"*, *"M08L"*, *"M09L"*, *"M10L"*, *"M11L"*, *"M12L"*</td>
<td>~skip-backward~</td>
</tr>
<tr>
<td>*"coptic"*</td>
<td>*"M13"*</td>
<td></td>
</tr>
<tr>
<td>*"dangi"*</td>
<td>*"M01L"*, *"M02L"*, *"M03L"*, *"M04L"*, *"M05L"*, *"M06L"*, *"M07L"*, *"M08L"*, *"M09L"*, *"M10L"*, *"M11L"*, *"M12L"*</td>
<td>~skip-backward~</td>
</tr>
<tr>
<td>*"ethioaa"*</td>
<td>*"M13"*</td>
<td></td>
</tr>
<tr>
<td>*"ethiopic"*</td>
<td>*"M13"*</td>
<td></td>
</tr>
<tr>
<td>*"hebrew"*</td>
<td>*"M05L"*</td>
<td>~skip-forward~</td>
</tr>
</table>
</emu-table>
</emu-clause>
<emu-clause id="sec-temporal-yearcontainsmonthcode" type="abstract operation">
<h1>
YearContainsMonthCode (
_calendar_: a calendar type that is not *"iso8601"*,
_arithmeticYear_: an integer,
_monthCode_: a month code,
): a Boolean
</h1>
<dl class="header">
<dt>description</dt>
<dd>
It returns whether the given _monthCode_ exists in _arithmeticYear_ of _calendar_.
</dd>
</dl>
<p>It performs the following steps when called:</p>
<emu-alg>
1. Assert: IsValidMonthCodeForCalendar(_calendar_, _monthCode_) is *true*.
1. If ! ParseMonthCode(_monthCode_).[[IsLeap]] is *false*, return *true*.
1. Return whether the leap month indicated by _monthCode_ exists in the year _arithmeticYear_ in _calendar_, using calendar-dependent behaviour.
</emu-alg>
</emu-clause>
<emu-clause id="sec-temporal-constrainmonthcode" type="abstract operation">
<h1>
ConstrainMonthCode (
_calendar_: a calendar type that is not *"iso8601"*,
_arithmeticYear_: an integer,
_monthCode_: a month code,
_overflow_: ~constrain~ or ~reject~,
): either a normal completion containing a month code or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>
It returns the month code in _arithmeticYear_ of _calendar_ that best matches the given _monthCode_. If _monthCode_ does not exist in _arithmeticYear_, it is constrained to the best common month if _overflow_ is ~constrain~, or an error is thrown if _overflow_ is ~reject~.
</dd>
</dl>
<p>It performs the following steps when called:</p>
<emu-alg>
1. Assert: IsValidMonthCodeForCalendar(_calendar_, _monthCode_) is *true*.
1. If YearContainsMonthCode(_calendar_, _arithmeticYear_, _monthCode_) is *true*, return _monthCode_.
1. If _overflow_ is ~reject~, throw a *RangeError* exception.
1. Assert: _calendar_ is listed in the "Calendar" column of <emu-xref href="#table-additional-month-codes"></emu-xref>.
1. Let _r_ be the row in <emu-xref href="#table-additional-month-codes"></emu-xref> with a value in the Calendar column matching _calendar_.
1. Let _shiftType_ be the value given in the "Leap to Common Month Transformation" column of _r_.
1. If _shiftType_ is ~skip-backward~, then
1. Return CreateMonthCode(! ParseMonthCode(_monthCode_).[[MonthNumber]], *false*).
1. Else,
1. Assert: _monthCode_ is *"M05L"*.
1. Return *"M06"*.
</emu-alg>
</emu-clause>
<emu-clause id="sec-temporal-monthcodetoordinal" type="abstract operation">
<h1>
MonthCodeToOrdinal (
_calendar_: a calendar type that is not *"iso8601"*,
_arithmeticYear_: an integer,
_monthCode_: a month code,
): an integer
</h1>
<dl class="header">
<dt>description</dt>
<dd>
It returns the ordinal month number for _monthCode_ in _arithmeticYear_ of _calendar_. The given _monthCode_ must exist in the given year.
</dd>
</dl>
<p>It performs the following steps when called:</p>
<emu-alg>
1. Assert: YearContainsMonthCode(_calendar_, _arithmeticYear_, _monthCode_) is *true*.
1. Let _monthsBefore_ be 0.
1. Let _number_ be 1.
1. Let _isLeap_ be *false*.
1. Let _r_ be the row in <emu-xref href="#table-additional-month-codes"></emu-xref> which the _calendar_ is in the Calendar column.
1. If the "Leap to Common Month Transformation" column of _r_ is empty, then
1. Return ! ParseMonthCode(_monthCode_).[[MonthNumber]].
1. Assert: The "Additional Month Codes" column of _r_ does not contain *"M00L"* or *"M13"*.
1. Assert: This algorithm will return before the following loop terminates by failing its condition.
1. Repeat, while _number_ ≤ 12,
1. Let _currentMonthCode_ be CreateMonthCode(_number_, _isLeap_).
1. If IsValidMonthCodeForCalendar(_calendar_, _currentMonthCode_) is *true* and YearContainsMonthCode(_calendar_, _arithmeticYear_, _currentMonthCode_) is *true*, then
1. Set _monthsBefore_ to _monthsBefore_ + 1.
1. If _currentMonthCode_ is _monthCode_, then
1. Return _monthsBefore_.
1. If _isLeap_ is *false*, then
1. Set _isLeap_ to *true*.
1. Else,
1. Set _isLeap_ to *false*.
1. Set _number_ to _number_ + 1.
</emu-alg>
</emu-clause>
<emu-clause id="sec-temporal-calendardaysinmonth" type="abstract operation">
<h1>
CalendarDaysInMonth (
_calendar_: a calendar type that is not *"iso8601"*,
_arithmeticYear_: an integer,
_ordinalMonth_: a positive integer,
): a positive integer
</h1>
<dl class="header">
<dt>description</dt>
<dd>
The returned value represents the number of days in the _calendar_-specific _arithmeticYear_ and _ordinalMonth_.
</dd>
</dl>
<p>It performs the following steps when called:</p>
<emu-alg>
1. Let _isoDate_ be ! CalendarIntegersToISO(_calendar_, _arithmeticYear_, _ordinalMonth_, 1).
1. Return CalendarISOToDate(_calendar_, _isoDate_).[[DaysInMonth]].
</emu-alg>
</emu-clause>
<emu-clause id="sec-temporal-calendardateera" type="abstract operation">
<h1>
CalendarDateEra (
_calendar_: a calendar type that is not *"iso8601"*,
_date_: an ISO Date Record,
): a String or *undefined*
</h1>
<dl class="header">
<dt>description</dt>
<dd>It performs implementation-defined processing to find the era for the date corresponding to _date_ in the context of the calendar represented by _calendar_ and returns a lowercase String value representing that era, or *undefined* for calendars that do not have eras.</dd>
</dl>
<emu-alg>
1. If CalendarSupportsEra(_calendar_) is *false*, return *undefined*.
1. Let _era_ be the String to indicate the era corresponding to _date_ in the context of the calendar represented by _calendar_ according to implementation-defined processing.
1. Return CanonicalizeEraInCalendar(_calendar_, _era_).
</emu-alg>
</emu-clause>
<emu-clause id="sec-temporal-calendardateerayear" type="abstract operation">
<h1>
CalendarDateEraYear (
_calendar_: a calendar type that is not *"iso8601"*,
_date_: an ISO Date Record,
): an integer or *undefined*
</h1>
<dl class="header">
<dt>description</dt>
<dd>It performs implementation-defined processing to find the era for the date corresponding to _date_ in the context of the calendar represented by _calendar_ and returns an integer representing the ordinal position of the year of _date_ in that era, or *undefined* for calendars that do not have eras.</dd>
</dl>
</dl>
<emu-alg>
1. If CalendarSupportsEra(_calendar_) is *false*, return *undefined*.
1. Let _eraYear_ be the integer to indicate the era year corresponding to _date_ in the context of the calendar represented by _calendar_ according to implementation-defined processing.
1. Assert: _eraYear_ is an integer.
1. Return _eraYear_.
</emu-alg>
</emu-clause>
<emu-clause id="sec-temporal-calendardatearithmeticyear" type="abstract operation">
<h1>
CalendarDateArithmeticYear (
_calendar_: a calendar type that is not *"iso8601"*,
_date_: an ISO Date Record,
): an integer
</h1>
<dl class="header">
<dt>description</dt>
<dd>It performs implementation-defined processing to find the arithmetic year for the date corresponding to _date_ in the context of the calendar represented by _calendar_.</dd>
</dl>
<emu-alg>
1. If _calendar_ is not listed in the "Calendar Type" column of <emu-xref href="#table-calendar-types"></emu-xref>, return an implementation-defined value.
1. Let _r_ be the row in <emu-xref href="#table-epoch-years"></emu-xref> with a value in the Calendar column matching _calendar_.
1. Let _epochYear_ be the value given in the "Epoch ISO Year" column of _r_.
1. Let _epochDate_ be the first day of the calendar year starting in ISO year _epochYear_ in the calendar represented by _calendar_, according to implementation-defined processing.
1. Let _newYear_ be the first day of the calendar year of _date_ in the calendar represented by _calendar_, according to implementation-defined processing.
1. Let _arithmeticYear_ be the signed number of whole years between _epochDate_ and _newYear_ in the calendar represented by _calendar_, according to implementation-defined processing.
1. Return _arithmeticYear_.
</emu-alg>
<emu-table id="table-epoch-years">
<emu-caption>Epoch years</emu-caption>
<table class="real-table">
<thead>
<tr>
<th>Calendar</th>
<th>Epoch ISO Year</th>
</tr>
</thead>
<tr>
<td>*"buddhist"*</td>
<td>-543</td>
</tr>
<tr>
<td>*"chinese"*</td>
<td>0</td>
</tr>
<tr>
<td>*"coptic"*</td>
<td>283</td>
</tr>
<tr>
<td>*"dangi"*</td>
<td>0</td>
</tr>
<tr>
<td>*"ethioaa"*</td>
<td>-5493</td>
</tr>
<tr>
<td>*"ethiopic"*</td>
<td>7</td>
</tr>
<tr>
<td>*"gregory"*</td>
<td>0</td>
</tr>
<tr>
<td>*"hebrew"*</td>
<td>-3761</td>
</tr>
<tr>
<td>*"indian"*</td>
<td>78</td>
</tr>
<tr>
<td>*"islamic-civil"*</td>
<td>621</td>
</tr>
<tr>
<td>*"islamic-tbla"*</td>
<td>621</td>
</tr>
<tr>
<td>*"islamic-umalqura"*</td>
<td>621</td>
</tr>
<tr>
<td>*"japanese"*</td>
<td>0</td>
</tr>
<tr>
<td>*"persian"*</td>
<td>621</td>
</tr>
<tr>
<td>*"roc"*</td>
<td>1911</td>
</tr>
</table>
</emu-table>
</emu-clause>
<emu-clause id="sec-temporal-calendardatearithmeticyearforerayear" type="abstract operation">
<h1>
CalendarDateArithmeticYearForEraYear (
_calendar_: a calendar type that has eras,
_era_: a String,
_eraYear_: an integer
): an integer
</h1>
<dl class="header">
<dt>description</dt>
<dd>It produces the arithmetic year for a given set of _era_, _eraYear_ in _calendar_, a calendar that includes an era named _era_.</dd>
</dl>
<emu-alg>
1. Let _era_ be CanonicalizeEraInCalendar(_calendar_, _era_).
1. Assert: _era_ is not *undefined*.
1. If _calendar_ is not listed in the "Calendar Type" column of <emu-xref href="#table-calendar-types"></emu-xref>, return an implementation-defined value.
1. Let _r_ be the row in <emu-xref href="#table-eras"></emu-xref> with a value in the Calendar column matching _calendar_ and a value in the Era column matching _era_.
1. Let _eraKind_ be the value given in the "Era Kind" column of _r_.
1. Let _offset_ be the value given in the "Offset" column of _r_.
1. If _eraKind_ is ~epoch~, return _eraYear_.
1. If _eraKind_ is ~negative~, return <emu-eqn>1 - _eraYear_</emu-eqn>.
1. Assert: _eraKind_ is ~offset~.
1. Assert: _offset_ is not *undefined*.
1. Return <emu-eqn>_offset_ + _eraYear_ - 1</emu-eqn>.
</emu-alg>
</emu-clause>
<emu-clause id="sec-temporal-calendarintegerstoiso" type="abstract operation">
<h1>
CalendarIntegersToISO (
_calendar_: a calendar type that is not *"iso8601"*,
_arithmeticYear_: an integer,
_ordinalMonth_: a positive integer,
_day_: a positive integer,
): either a normal completion containing an ISO Date Record or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>
It returns an ISO Date Record that corresponds with the given _calendar_-specific _arithmeticYear_, _ordinalMonth_, and _day_.
</dd>
</dl>
<p>It performs the following steps when called:</p>
<emu-alg>
1. If _arithmeticYear_, _ordinalMonth_, and _day_ do not form a valid date in _calendar_, throw a *RangeError* exception.
1. Let _isoDate_ be an ISO Date Record such that CalendarISOToDate(_calendar_, _isoDate_) returns a Calendar Date Record whose [[Year]], [[Month]], and [[Day]] field values respectively equal _arithmeticYear_, _ordinalMonth_, and _day_.
1. NOTE: No known calendars have repeated dates that would cause _isoDate_ to be ambiguous between two ISO Date Records.
1. Return _isoDate_.
</emu-alg>
</emu-clause>
<emu-clause id="sup-temporal-calendar-date-records">
<h1>Calendar Date Records</h1>
<p>
A <dfn variants="Calendar Date Records">Calendar Date Record</dfn> is a Record value used to represent a valid calendar date in a non-ISO 8601 calendar.
Calendar Date Records are produced by the abstract operation CalendarISOToDate.
</p>
<p>Calendar Date Records have the fields listed in <emu-xref href="#table-temporal-calendar-date-record-fields"></emu-xref>.</p>
<p>This definition supersedes the one in <emu-xref href="#sec-temporal-calendar-date-records"></emu-xref>.</p>
<emu-table id="table-temporal-calendar-date-record-fields" caption="Calendar Date Record Fields">
<table class="real-table">
<tr>
<th>Field Name</th>
<th>Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>[[Era]]</td>
<td>a String or *undefined*</td>
<td>
A lowercase String value representing the date's era, or *undefined* for calendars that do not have eras.<br>
The value of this field for a calendar type _calendar_ should be the result of calling CalendarDateEra(_calendar_, _date_), where _date_ is the [[ISODate]] field of a Temporal.PlainDateTime, Temporal.PlainDate, or Temporal.PlainYearMonth value corresponding to the date.
</td>
</tr>
<tr>
<td>[[EraYear]]</td>
<td>an integer or *undefined*</td>
<td>
The ordinal position of the date's year within its era, or *undefined* for calendars that do not have eras.<br>
The value of this field for a calendar type _calendar_ should be the result of calling CalendarDateEraYear(_calendar_, _date_), where _date_ is the [[ISODate]] field of a Temporal.PlainDateTime, Temporal.PlainDate, or Temporal.PlainYearMonth value corresponding to the date.
<emu-note>
Era years are 1-indexed for many calendars, but not all (e.g., the eras of the Burmese calendar, not currently available in CLDR, each start with a year 0). Years can also advance opposite the flow of time (as for BCE years in the Gregorian calendar).
</emu-note>
</td>
</tr>
<tr>
<td>[[Year]]</td>
<td>an integer</td>
<td>
The date's <dfn>arithmetic year</dfn>, which is the year relative to the first day of a calendar-specific <dfn>epoch year</dfn>, given in <emu-xref href="#table-epoch-years"></emu-xref>.<br>
The value of this field for a calendar type _calendar_ should be the result of calling CalendarDateArithmeticYear(_calendar_, _date_), where _date_ is the [[ISODate]] field of a Temporal.PlainDateTime, Temporal.PlainDate, or Temporal.PlainYearMonth value corresponding to the date.
<emu-note>The arithmetic year is relative to the first day of the calendar's epoch year, so if the epoch era starts in the middle of the year, the year will be the same value before and after the start date of the era.</emu-note>
</td>
</tr>
<tr>
<td>[[Month]]</td>
<td>a positive integer</td>
<td>
The 1-based ordinal position of the date's month within its year.
<emu-note>
When the number of months in a year of the calendar is variable, a different value can be returned for dates that are part of the same month in different years. For example, in the Hebrew calendar, 1 Nisan 5781 is associated with value 7 while 1 Nisan 5782 is associated with value 8 because 5782 is a leap year and Nisan follows the insertion of Adar I.
</emu-note>
</td>
</tr>
<tr>
<td>[[MonthCode]]</td>
<td>a String</td>
<td>
The month code of the date's month. The month code for a month that is not a leap month and whose 1-based ordinal position in a common year of the calendar (i.e., a year that is not a leap year) is _n_ should be the string-concatenation of *"M"* and ToZeroPaddedDecimalString(_n_, 2), and the month code for a month that is a leap month inserted after a month whose 1-based ordinal position in a common year of the calendar is _p_ should be the string-concatenation of *"M"*, ToZeroPaddedDecimalString(_p_, 2), and *"L"*.
<emu-note>
For example, in the Hebrew calendar, the month code of Adar (and Adar II, in leap years) is *"M06"* and the month code of Adar I (the leap month inserted before Adar II) is *"M05L"*. Theoretically, in a calendar with a leap month at the start of some years, the month code of that month would be *"M00L"*.
</emu-note>
</td>
</tr>
<tr>
<td>[[Day]]</td>
<td>a positive integer</td>
<td>
The 1-based ordinal position of the date's day within its month.
</td>
</tr>
<tr>
<td>[[DayOfWeek]]</td>
<td>a positive integer</td>
<td>
The day of the week corresponding to the date. The value should be 1-based, where 1 is the day corresponding to Monday in the given calendar.
</td>
</tr>
<tr>
<td>[[DayOfYear]]</td>
<td>a positive integer</td>
<td>
The 1-based ordinal position of the date's day within its year.
</td>
</tr>
<tr>
<td>[[WeekOfYear]]</td>
<td>a Year-Week Record</td>
<td>
<p>The date's <em>calendar week of year</em>, and the corresponding <em>week calendar year</em>.</p>
<p>The Year-Week Record's [[Week]] field should be 1-based.</p>
<p>The Year-Week Record's [[Year]] field is an arithmetic year as in the Calendar Date Record's [[Year]] field, not relative to an era as in [[EraYear]].</p>
<p>
Usually the Year-Week Record's [[Year]] field will contain the same value as the Calendar Date Record's [[Year]] field, but may contain the previous or next year if the week number in the Year-Week Record's [[Week]] field overlaps two different years.
See also ISOWeekOfYear.
</p>
<p>The Year-Week Record contains *undefined* in [[Week]] and [[Year]] field for calendars that do not have a well-defined week numbering system.</p>
<emu-note>
Currently, of the calendars supported in this specification, only *"iso8601"* has a well-defined, locale-independent week numbering system.
For all other calendars, the Year-Week Record fields are *undefined*.
</emu-note>
</td>
</tr>