(old name "Intl Temporal Proposal")
To specify necessary details about era, eraYear and monthCode usage with Temporal in internationalization setting (for calendars other than "iso8601").
This proposal is advanced to Stage 2 for ECMA402 during the TC39 meeting, Feb 1 2023. (Link to be added after the meeting notes is approved by TC39 in March) This proposal is advanced to Stage 1 for ECMA402 during the TC39 meeting, Dec 1 2022.
During the Feb 1 2023 TC39 meeting, the following members agree to serve as the Stage 3 Reviewers of this proposal:
- EAO (Eemeli Aro) from Mozilla
- SFC (Shane Carr) from Google
- Intl era and monthCode proposal for Stage 1, TC39 Nov 2022 Meeting, Nov 29-Dec 1, 2022
- Intl era and monthCode proposal for Stage 2, TC39 Jan 2023 Meeting, Jan 23-Jan 26, 2023
- Draft Spec
- Study of modles of year and era in ICU Calendar
- Temporal Internationalization Calendars Design Doc.
Temporal proposal is a ECMA262 Stage proposal to “provide standard objects and functions for working with dates and times.” The Temporal proposal specification text clearly specified how the “iso8601” Calendar and “UTC” TimeZone should behave as well as define name and some basic aspect of Calenders other than “iso8601” and TimeZone other than “UTC”. However, there are additional requirements needed for implementation purposes. This proposal aims to define these details which should be eventually merged into ECMA402 specification.
We believe the following Abstract Opertaions defined in the Temporal proposal need to be defined in more details in this proposal:
- 15.6.1.3 CalendarDateToISO ( calendar, fields, overflow )
- Need to specify the condition of throwing RangeError exception
- 15.6.1.4 CalendarDateAddition ( calendar, date, duration, overflow )
- Need to specify the condition of throwing RangeError exception
- 15.6.1.5 CalendarDateDifference ( calendar, one, two, largestUnit )
- Need to specify the condition of throwing RangeError exception
- 15.6.1.6 CalendarDateEra ( calendar, date )
- Need to define the possible era codes for each calendar and which calnedar will return undefined.
- 15.6.1.7 CalendarDateEraYear ( calendar, date() )
- Need to define which calnedar will return undefined.
- 15.6.1.9 CalendarDateMonth ( calendar, date )
- Need to define the meaning of month for some calendars.
- 15.6.1.10 CalendarDateMonthCode ( calendar, date )
- Need to define the valid set of monthCodes for each calendar.
- 15.6.1.20 CalendarDateFields ( calendar, fields )
- Need to define which calendar will add "era" and "eraYear".
- 15.6.1.21 CalendarDateMergeFields ( calendar, fields, additionalFields )
- Need to define which calendar will merge "era" and "eraYear" and how it merge "era" and "eraYear" .
We may choose to specify certain calendar arithmetic for some calendars if they are very simple to conver from/to "iso8601" calendar- For example, for "gregory", "roc", "buddhist", "japanese" calendar, but leave the arithmetic in vague language for others.
We are NOT aiming to specify the calendar arithmetic for the following part of Temporal proposal:
- 15.6.1.8 CalendarDateYear ( calendar, date )
- 15.6.1.11 CalendarDateDay ( calendar, date )
- 15.6.1.12 CalendarDateDayOfWeek ( calendar, date )
- 15.6.1.13 CalendarDateDayOfYear ( calendar, date )
- 15.6.1.14 CalendarDateWeekOfYear ( calendar, date )
- 15.6.1.15 CalendarDateDaysInWeek ( calendar, date )
- 15.6.1.16 CalendarDateDaysInMonth ( calendar, date )
- 15.6.1.17 CalendarDateDaysInYear ( calendar, date )
- 15.6.1.18 CalendarDateMonthsInYear ( calendar, date )
- 15.6.1.19 CalendarDateInLeapYear ( calendar, date )
Related spec text in Temporal proposal:
- 15.6.2.6 Temporal.Calendar.prototype.era ( temporalDateLike )
- 15.6.5.2 get Temporal.PlainDate.prototype.era
- 15.6.6.2 get Temporal.PlainDateTime.prototype.era
- 15.6.9.2 get Temporal.PlainYearMonth.prototype.era
- 15.6.10.2 get Temporal.ZonedDateTime.prototype.era
- 15.6.1.3 CalendarDateToISO ( calendar, fields, overflow )
For Calendar:
-
List of 'calendar': CLDR and ICU support the following calendars beside "iso8601" and currently supported by Intl.DateTimeFormat API in different browsers.
- "gregory""
- "roc" (same as "gregory" except handling of era and year)
- "buddhist" (same as "gregory" except handling of era and year)
- "japanese" (same as "gregory" except handling of era and year)
- "persian"
- "coptic"
- "ethiopic"
- "ethiopic-ameta-alem" (same as "ethiopic" except handling of era and year)
- "indian""
- "hebrew"
- "chinese"
- "dangi" (same as "chinese" except the referencing timeZone)
- "islamic"
- "islamic-tbla"
- "islamic-umalqura"
- "islamic-civil"
-
Requirement for era and eraYear:
- The combination of era and eraYear in a calendar need to be able to uniquely identify a particular year in the timeline.
- era need to be a String (per 15.6.1.1 CalendarEra in Temporal).
- eraYear need to be an Integer (per 15.6.1.2 CalendarEraYear in Temporal).
- If there is only one era in a calendar, we do not need to and should avoid using the era/eraYear in that calendar (e.g. "hebrew", "persian")
- If we define era, we need to also define the behavior if the field(s) is/are absent. (fallback to use year or fallback to a default value and what is the default value)
-
'gregory': TBW
Related spec text in Temporal proposal:
- 15.6.2.7 Temporal.Calendar.prototype.eraYear ( temporalDateLike )
- 15.6.5.3 get Temporal.PlainDate.prototype.eraYear
- 15.6.6.3 get Temporal.PlainDateTime.prototype.eraYear
- 15.6.9.3 get Temporal.PlainYearMonth.prototype.eraYear
- 15.6.10.3 get Temporal.ZonedDateTime.prototype.eraYear
- 15.6.1.3 CalendarDateToISO ( calendar, fields, overflow )
For Calendar:
- 'gregory': TBW
Related spec text in Temporal proposal: *
For Calendar:
- 'gregory': TBW
Related spec text in Temporal proposal: *
For Calendar:
- 'gregory': TBW