theme | paginate | style |
---|---|---|
gaia |
true |
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css');
@import url('https://cdn.jsdelivr.net/npm/hack-font@3/build/web/hack-subset.css');
@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,400;0,700;1,400;1,700&display=swap');
code { font-family: Hack; }
section { font-family: Rubik, sans-serif; letter-spacing: 0; }
section.lead.invert { text-shadow: 0 0 10px black, 0 0 20px black; }
section.smaller-type li { font-size: 85% }
pre code { background-color: #042029; }
.hljs-string { color: #8ae234; }
.hljs-number, .hljs-literal { color: #729fcf; }
.hljs-params { color: #e9b96e; font-style: italic; }
.hljs-built_in { color: #fce94f; font-weight: bold; }
.hljs-keyword { color: #fcaf3e; font-weight: bold; }
.hljs-attr { color: #e9b96e; }
.hljs-variable { color: red; font-weight: bold; }
/* .hljs-comment, .hljs-regexp, .hljs-symbol */
|
Philip Chimento
Igalia, in partnership with Bloomberg
TC39-TG2 February 2022
- Stage 3 TC39 proposal
- Introduces 7 data types for representing dates and times
- As well,
Temporal.Duration
for representing lengths of time Temporal.TimeZone
andTemporal.Calendar
allow calculations with time zones and calendars
Temporal.Instant
: exact time, no time zone or calendarTemporal.ZonedDateTime
: exact time, with time zone and calendarTemporal.PlainDateTime
: wall-clock time, with calendarTemporal.PlainTime
,Temporal.PlainDate
,Temporal.PlainYearMonth
,Temporal.PlainMonthDay
: wall-clock time / wall-calendar date, with less information
- An annex to Temporal lists all modifications that would be made to Ecma-402
- Some open questions that require a decision from TG2
- https://tc39.es/proposal-temporal#sec-temporal-intl
- Mostly concerns Intl.DateTimeFormat and calendar support
Disregard this section; it's going to be removed.
(Originally the idea was to take IsValidTimeZoneName, CanonicalizeTimeZoneName, and DefaultTimeZone into Ecma-262.)
This abstract operation is proposed to be moved into Ecma-262, so there's no need to keep a separate copy in Ecma-402.
Temporal requires having a different "pattern" for each Temporal type, instead of one pattern for formatting Date
, so we adapt Intl.DateTimeFormat
accordingly.
(There is an issue open about storage requirements for Intl.DateTimeFormat
: #602)
- Without Ecma-402, Temporal only knows the ISO 8601 calendar, specified exactly
- Add
era()
anderaYear()
methods toTemporal.Calendar
- Add
era
anderaYear
properties toPlain
types - Supersede the ISO calendar operations defined in Ecma-262
- Non-ISO calendar operations are specified loosely
- Just how loosely is still a matter of debate
- Pull request: tc39/proposal-temporal#1928
These may or may not require discussion / action from TG2.
- TG2 issue: #540
- Rough agreement in GitHub issue
- Temporal issue: #2013
- FormatDateTimePattern will have to gain a time zone argument, so that the ZonedDateTime's time zone overrides the time zone in the [[TimeZone]] internal slot of the
Intl.DateTimeFormat
object
- Temporal issue: #2005
- The [[TimeZone]] and [[Calendar]] internal slots of DateTimeFormat should be Temporal instances, not strings
- Temporal also accepts property-bag time zones and calendars that implement the protocol
const timeZone = {
getOffsetNanosecondsFor(instant) { ... },
getPossibleInstantsFor(dateTime) { ... },
toString() { return "Etc/My_Zone"; }
};
const dateTime = Temporal.Now.zonedDateTimeISO(timeZone);
dateTime.toLocaleString(); // Should this code succeed or fail? What should be the result?
These will likely need user research from TG2.
- What's the behaviour of date arithmetic around epagomenal days? p-t#1994
- What should be the anchor year for the Ethiopic calendar? #534
- What era should be used for the Hebrew calendar? #535
- Designing unique identifiers for eras #541