diff --git a/spec/annexes.html b/spec/annexes.html index 95079e09..aca91b12 100644 --- a/spec/annexes.html +++ b/spec/annexes.html @@ -181,6 +181,12 @@
The value of the [[LocaleData]] internal slot is implementation-defined within the constraints described in
Finally, Intl.DateTimeFormat instances have a [[BoundFormat]] internal slot that caches the function returned by the format accessor (
Each Value Format Record has the fields defined in
| Field Name | +Value Type | +
|---|---|
| [[Format]] | +a DateTime Format Record | +
| [[EpochNanoseconds]] | +an epoch nanoseconds value | +
| [[IsPlain]] | +a Boolean | +
When the `format` method is called with an argument _duration_, the following steps are taken:
+When the `format` method is called with an argument _durationLike_, the following steps are taken:
When the `formatToParts` method is called with an argument _duration_, the following steps are taken:
+When the `formatToParts` method is called with an argument _durationLike_, the following steps are taken:
A Duration Record is a Record value used to represent a Duration.
-Duration Records have the fields listed in
| Field | -Meaning | -
|---|---|
| [[Years]] | -- The number of years in the duration. - | -
| [[Months]] | -- The number of months in the duration. - | -
| [[Weeks]] | -- The number of weeks in the duration. - | -
| [[Days]] | -- The number of days in the duration. - | -
| [[Hours]] | -- The number of hours in the duration. - | -
| [[Minutes]] | -- The number of minutes in the duration. - | -
| [[Seconds]] | -- The number of seconds in the duration. - | -
| [[Milliseconds]] | -- The number of milliseconds in the duration. - | -
| [[Microseconds]] | -- The number of microseconds in the duration. - | -
| [[Nanoseconds]] | -- The number of nanoseconds in the duration. - | -
| Value Field | -Internal Slot | +Duration Internal Slot | +Formatter Internal Slot | Unit | NumberFormat Unit | |
|---|---|---|---|---|---|---|
| Calendar | +Era | +Aliases | +Minimum eraYear | +Maximum eraYear | +Era Kind | +Offset | +
|---|---|---|---|---|---|---|
| *"buddhist"* | +*"be"* | ++ | -∞ | ++∞ | +~epoch~ | ++ |
| *"coptic"* | +*"am"* | ++ | -∞ | ++∞ | +~epoch~ | ++ |
| *"ethioaa"* | +*"aa"* | ++ | -∞ | ++∞ | +~epoch~ | ++ |
| *"ethiopic"* | +*"am"* | ++ | 1 | ++∞ | +~epoch~ | ++ |
| *"ethiopic"* | +*"aa"* | ++ | -∞ | +5500 | +~offset~ | +-5499 | +
| *"gregory"* | +*"ce"* | +*"ad"* | +1 | ++∞ | +~epoch~ | ++ |
| *"gregory"* | +*"bce"* | +*"bc"* | +1 | ++∞ | +~negative~ | ++ |
| *"hebrew"* | +*"am"* | ++ | -∞ | ++∞ | +~epoch~ | ++ |
| *"indian"* | +*"shaka"* | ++ | -∞ | ++∞ | +~epoch~ | ++ |
| *"islamic-civil"* | +*"ah"* | ++ | 1 | ++∞ | +~epoch~ | ++ |
| *"islamic-civil"* | +*"bh"* | ++ | 1 | ++∞ | +~negative~ | ++ |
| *"islamic-tbla"* | +*"ah"* | ++ | 1 | ++∞ | +~epoch~ | ++ |
| *"islamic-tbla"* | +*"bh"* | ++ | 1 | ++∞ | +~negative~ | ++ |
| *"islamic-umalqura"* | +*"ah"* | ++ | 1 | ++∞ | +~epoch~ | ++ |
| *"islamic-umalqura"* | +*"bh"* | ++ | 1 | ++∞ | +~negative~ | ++ |
| *"japanese"* | +*"reiwa"* | ++ | 1 | ++∞ | +~offset~ | +2019 | +
| *"japanese"* | +*"heisei"* | ++ | 1 | +31 | +~offset~ | +1989 | +
| *"japanese"* | +*"showa"* | ++ | 1 | +64 | +~offset~ | +1926 | +
| *"japanese"* | +*"taisho"* | ++ | 1 | +15 | +~offset~ | +1912 | +
| *"japanese"* | +*"meiji"* | ++ | 6 | +45 | +~offset~ | +1868 | +
| *"japanese"* | +*"ce"* | +*"ad"* | +1 | +1872 | +~epoch~ | ++ |
| *"japanese"* | +*"bce"* | +*"bc"* | +1 | ++∞ | +~negative~ | ++ |
| *"persian"* | +*"ap"* | ++ | -∞ | ++∞ | +~epoch~ | ++ |
| *"roc"* | +*"roc"* | ++ | 1 | ++∞ | +~epoch~ | ++ |
| *"roc"* | +*"broc"* | ++ | 1 | ++∞ | +~negative~ | ++ |
| Calendar | +Additional Month Codes | +Leap to Common Month Transformation | +
|---|---|---|
| *"chinese"* | +*"M01L"*, *"M02L"*, *"M03L"*, *"M04L"*, *"M05L"*, *"M06L"*, *"M07L"*, *"M08L"*, *"M09L"*, *"M10L"*, *"M11L"*, *"M12L"* | +~skip-backward~ | +
| *"coptic"* | +*"M13"* | ++ |
| *"dangi"* | +*"M01L"*, *"M02L"*, *"M03L"*, *"M04L"*, *"M05L"*, *"M06L"*, *"M07L"*, *"M08L"*, *"M09L"*, *"M10L"*, *"M11L"*, *"M12L"* | +~skip-backward~ | +
| *"ethioaa"* | +*"M13"* | ++ |
| *"ethiopic"* | +*"M13"* | ++ |
| *"hebrew"* | +*"M05L"* | +~skip-forward~ | +
It performs the following steps when called:
+It performs the following steps when called:
+It performs the following steps when called:
+It performs the following steps when called:
+| Calendar | +Epoch ISO Year | +
|---|---|
| *"buddhist"* | +-543 | +
| *"chinese"* | +0 | +
| *"coptic"* | +283 | +
| *"dangi"* | +0 | +
| *"ethioaa"* | +-5493 | +
| *"ethiopic"* | +7 | +
| *"gregory"* | +0 | +
| *"hebrew"* | +-3761 | +
| *"indian"* | +78 | +
| *"islamic-civil"* | +621 | +
| *"islamic-tbla"* | +621 | +
| *"islamic-umalqura"* | +621 | +
| *"japanese"* | +0 | +
| *"persian"* | +621 | +
| *"roc"* | +1911 | +
It performs the following steps when called:
++ A Calendar Date Record 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. +
+Calendar Date Records have the fields listed in
This definition supersedes the one in
| Field Name | +Value | +Meaning | +
|---|---|---|
| [[Era]] | +a String or *undefined* | +
+ A lowercase String value representing the date's era, or *undefined* for calendars that do not have eras. + 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. + |
+
| [[EraYear]] | +an integer or *undefined* | +
+ The ordinal position of the date's year within its era, or *undefined* for calendars that do not have eras. + 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. + |
+
| [[Year]] | +an integer | +
+ The date's arithmetic year, which is the year relative to the first day of a calendar-specific epoch year, given in + 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. + |
+
| [[Month]] | +a positive integer | +
+ The 1-based ordinal position of the date's month within its year.
+ |
+
| [[MonthCode]] | +a String | +
+ 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"*.
+ |
+
| [[Day]] | +a positive integer | ++ The 1-based ordinal position of the date's day within its month. + | +
| [[DayOfWeek]] | +a positive integer | ++ 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. + | +
| [[DayOfYear]] | +a positive integer | ++ The 1-based ordinal position of the date's day within its year. + | +
| [[WeekOfYear]] | +a Year-Week Record | +
+ The date's calendar week of year, and the corresponding week calendar year. +The Year-Week Record's [[Week]] field should be 1-based. +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]]. ++ 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. + +The Year-Week Record contains *undefined* in [[Week]] and [[Year]] field for calendars that do not have a well-defined week numbering system. + |
+
| [[DaysInWeek]] | +a positive integer | +
+ The number of days in the primary notion of week used by the calendar. For all calendars currently supported by this specification, this number is 7. + |
+
| [[DaysInMonth]] | +a positive integer | +The number of days in the date's month. | +
| [[DaysInYear]] | +a positive integer | +The number of days in the date's year. | +
| [[MonthsInYear]] | +a positive integer | +The number of months in the date's year. | +
| [[InLeapYear]] | +a Boolean | +
+ *true* if the date falls within a leap year, and *false* otherwise.
+ |
+
It performs the following steps when called:
+It performs the following steps when called:
+It performs the following steps when called:
+All calendars follow the steps given here, which is a generalization of the precise algorithm specified in CalendarDateAdd for *"iso8601"*.
+This definition supersedes the definition provided in
It performs the following steps when called:
+All calendars follow the steps given here, which is a generalization of the precise algorithm specified in CalendarDateUntil for *"iso8601"*.
+This definition supersedes the definition provided in
It performs the following steps when called:
+Like RegulateISODate, the operation throws a *RangeError* exception when _overflow_ is ~reject~ and the date described by _fields_ does not exist.
+Clamping an invalid date to the correct range when _overflow_ is ~constrain~ is a behaviour specific to each calendar other than *"iso8601"*, but all calendars follow this guideline.
+This definition supersedes the definition provided in
It performs the following steps when called:
+
+ The fields of the returned ISO Date Record represent a reference date in the ISO 8601 calendar that, when converted to _calendar_, corresponds to the month code and day of _fields_ in an arbitrary but deterministically chosen reference year.
+ The reference year is almost always 1972 (the first ISO 8601 leap year after the epoch), with exceptions for calendars where some dates (e.g. leap days or days in leap months) didn't occur during that ISO 8601 year.
+ These exceptions are listed in
This definition supersedes the definition provided in
It performs the following steps when called:
+| Calendar Type | +Month Code | +Reference Year (Days 1–29) | +Reference Year ( |
+
|---|---|---|---|
| *"buddhist"*, *"gregory"*, *"indian"*, *"japanese"*, *"persian"*, *"roc"* | +any | +Any day including 31: 1972 | +|
| *"chinese"*, *"dangi"* | +M01 | +1972 | +1970 | +
| M01L | +— | +— | +|
| M02 | +1972 | +||
| M02L | +1947 | +— | +|
| M03 | +1972 | +*"chinese"*: 1966 + *"dangi"*: 1968 |
+ |
| M03L | +1966 | +1955 | +|
| M04 | +1972 | +1970 | +|
| M04L | +1963 | +1944 | +|
| M05 | +1972 | +||
| M05L | +1971 | +1952 | +|
| M06 | +1972 | +1971 | +|
| M06L | +1960 | +1941 | +|
| M07 | +1972 | +||
| M07L | +1968 | +1938 | +|
| M08 | +1972 | +1971 | +|
| M08L | +1957 | +— | +|
| M09 | +1972 | +||
| M09L | +2014 | +— | +|
| M10 | +1972 | +||
| M10L | +1984 | +— | +|
| M11 | +1972 | +1970 | +|
| M11L | +Days 1–10: 2033 + Days 11–29: 2034 |
+ — | +|
| M12 | +1972 | +||
| M12L | +— | +— | +|
| *"coptic"*, *"ethioaa"*, *"ethiopic"* | +M13 | +Days 1–5: 1972 + + Days 7–29: — |
+ — | +
| others | +1972 | +||
| *"hebrew"* | +M02 | +1972 | +1971 | +
| M03 | +1972 | +1971 | +|
| M05L | +1970 | +||
| others | +1972 | +||
| *"islamic-civil"*, *"islamic-tbla"* | +M12 | +1972 | +1971 | +
| others | +1972 | +||
| *"islamic-umalqura"* | +M01 | +1972 | +|
| M02 | +1972 | +1970 | +|
| M03 | +1972 | +1971 | +|
| M04 | +1972 | +||
| M05 | +1972 | +1971 | +|
| M06 | +1972 | +||
| M07 | +1972 | +1969 | +|
| M08 | +1972 | +||
| M09 | +1972 | +||
| M10 | +1972 | +1970 | +|
| M11 | +1972 | +||
| M12 | +1972 | +1971 | +|
This definition supersedes the definition provided in
It performs the following steps when called:
+This definition supersedes the definition provided in
It performs the following steps when called:
+This definition supersedes the definition provided in
It performs the following steps when called:
+The ASCII-uppercase of a String value _S_ is the String value derived from _S_ by replacing each occurrence of an ASCII lowercase letter code unit (0x0061 through 0x007A, inclusive) with the corresponding ASCII uppercase letter code unit (0x0041 through 0x005A, inclusive) while preserving all other code units.
-The ASCII-lowercase of a String value _S_ is the String value derived from _S_ by replacing each occurrence of an ASCII uppercase letter code unit (0x0041 through 0x005A, inclusive) with the corresponding ASCII lowercase letter code unit (0x0061 through 0x007A, inclusive) while preserving all other code units.
-A String value _A_ is an ASCII-case-insensitive match for String value _B_ if the ASCII-uppercase of _A_ is exactly the same sequence of code units as the ASCII-uppercase of _B_. A sequence of Unicode code points _A_ is an ASCII-case-insensitive match for _B_ if _B_ is an ASCII-case-insensitive match for CodePointsToString(_A_).
+ ECMA-262 describes calendar types, of which *"iso8601"* is required to be supported. + This specification additionally requires ECMAScript implementations to support an explicit subset of calendar types defined in the Unicode Common Locale Data Repository (CLDR) and prohibits them from supporting other calendar types, although future editions may expand the list. +
-This specification identifies calendars using a calendar type as defined by Unicode Technical Standard #35 Part 4 Dates, Section 2 Calendar Elements. 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).
++ The following table lists the sanctioned calendar types, along with implementation notes and sources where necessary. + All calendar types must use a proleptic reckoning, meaning that the current rules for calendrical calculations are extended indefinitely into the past, ignoring dates when historical calendar reforms happened. +
-+ 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. +
+ +| Calendar Type | +Description and implementation notes | +
|---|---|
| *"buddhist"* | +Thai Buddhist calendar. 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. | +
| *"chinese"* | +Traditional Chinese calendar. Lunisolar calendar, based on data published by the Purple Mountain Observatory for dates between 1900 and 2100 (which complies with GB/T 33661-2017, Calculation and Promulgation of the Chinese Calendar), falling back to an implementation-defined approximation outside that range. The arithmetic year is as in *"gregory"*, and there are no eras. | +
| *"coptic"* | +Coptic calendar. Similar solar algorithm to *"ethioaa"* and *"ethiopic"* but with a different epoch year. There is one era, starting in the epoch year. | +
| *"dangi"* | +Traditional Korean calendar. Lunisolar calendar, based on data published by the Korea Astronomy and Space Science Institute (KASI) 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. | +
| *"ethioaa"* | +Ethiopian calendar, 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. | +
| *"ethiopic"* | +Ethiopian calendar, 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. | +
| *"ethiopic-amete-alem"* | +Alias for *"ethioaa"*. | +
| *"gregory"* | +Gregorian calendar. 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. | +
| *"hebrew"* | +Hebrew calendar. 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. | +
| *"indian"* | +Indian national (or Śaka) calendar. Solar calendar with one era. | +
| *"islamic-civil"* | +Tabular Hijri calendar 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) | +
| *"islamic-tbla"* | +Tabular Hijri calendar 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) | +
| *"islamic-umalqura"* | +Hijri calendar, 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. | +
| *"islamicc"* | +Alias for *"islamic-civil"*. | +
| *"iso8601"* | +ISO 8601 calendar. Fully specified in ECMA-262. | +
| *"japanese"* | +Japanese Imperial calendar, 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"*. | +
| *"persian"* | +Persian (or Solar Hijri) calendar. There is one era. Solar calendar using leap years as published by the Iranian calendar authority for dates between 1206 AP and 1498 AP, falling back to an implementation-defined approximation outside that range. | +
| *"roc"* | +Republic of China (or Minguo) calendar. 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"*. | +
This definition supersedes the definition provided in
It performs the following steps when called:
+This definition supersedes the definition provided in
It performs the following steps when called:
+ +| Identifier | -Description | -Examples: Round to 0 fraction digits | -||||
|---|---|---|---|---|---|---|
| -1.5 | -0.4 | -0.5 | -0.6 | -1.5 | -||
| *"ceil"* | -Toward positive infinity | -⬆️ [-1] | -⬆️ [1] | -⬆️ [1] | -⬆️ [1] | -⬆️ [2] | -
| *"floor"* | -Toward negative infinity | -⬇️ [-2] | -⬇️ [0] | -⬇️ [0] | -⬇️ [0] | -⬇️ [1] | -
| *"expand"* | -Away from zero | -⬇️ [-2] | -⬆️ [1] | -⬆️ [1] | -⬆️ [1] | -⬆️ [2] | -
| *"trunc"* | -Toward zero | -⬆️ [-1] | -⬇️ [0] | -⬇️ [0] | -⬇️ [0] | -⬇️ [1] | -
| *"halfCeil"* | -Ties toward positive infinity | -⬆️ [-1] | -⬇️ [0] | -⬆️ [1] | -⬆️ [1] | -⬆️ [2] | -
| *"halfFloor"* | -Ties toward negative infinity | -⬇️ [-2] | -⬇️ [0] | -⬇️ [0] | -⬆️ [1] | -⬇️ [1] | -
| *"halfExpand"* | -Ties away from zero | -⬇️ [-2] | -⬇️ [0] | -⬆️ [1] | -⬆️ [1] | -⬆️ [2] | -
| *"halfTrunc"* | -Ties toward zero | -⬆️ [-1] | -⬇️ [0] | -⬇️ [0] | -⬆️ [1] | -⬇️ [1] | -
| *"halfEven"* | -Ties toward an even rounding increment multiple | -⬇️ [-2] | -⬇️ [0] | -⬇️ [0] | -⬆️ [1] | -⬆️ [2] | -
Finally, Intl.NumberFormat instances have a [[BoundFormat]] internal slot that caches the function returned by the format accessor (
| Identifier | -Sign | -Unsigned Rounding Mode | -
|---|---|---|
| *"ceil"* | -~positive~ | -~infinity~ | -
| ~negative~ | -~zero~ | -|
| *"floor"* | -~positive~ | -~zero~ | -
| ~negative~ | -~infinity~ | -|
| *"expand"* | -~positive~ | -~infinity~ | -
| ~negative~ | -~infinity~ | -|
| *"trunc"* | -~positive~ | -~zero~ | -
| ~negative~ | -~zero~ | -|
| *"halfCeil"* | -~positive~ | -~half-infinity~ | -
| ~negative~ | -~half-zero~ | -|
| *"halfFloor"* | -~positive~ | -~half-zero~ | -
| ~negative~ | -~half-infinity~ | -|
| *"halfExpand"* | -~positive~ | -~half-infinity~ | -
| ~negative~ | -~half-infinity~ | -|
| *"halfTrunc"* | -~positive~ | -~half-zero~ | -
| ~negative~ | -~half-zero~ | -|
| *"halfEven"* | -~positive~ | -~half-even~ | -
| ~negative~ | -~half-even~ | -