TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Add Temporal (Stage 3) types

Open milkcask opened this issue 1 year ago • 1 comments

⚙ Compilation target

ESNext

⚙ Library

n/a

Missing / Incorrect Definition

  • Temporal
  • Temporal.Now
  • Temporal.Instant
  • Temporal.ZonedDateTime
  • Temporal.PlainDate, Temporal.PlainTime, Temporal.PlainDateTime
  • Temporal.PlainYearMonth, Temporal.PlainMonthDay
  • Temporal.Duration

Sample Code

const now = Temporal.Now.instant();
const past = Temporal.Instant.from('1969-07-20T20:17Z');

Documentation Link

https://tc39.es/proposal-temporal/docs/index.html

The API itself is quite stable. It is calendar that is blocking implementation.

milkcask avatar Oct 07 '24 23:10 milkcask

FYI: Deno has implemented it quite long ago: Temporal - Web - Deno Docs

ooker777 avatar Oct 19 '24 16:10 ooker777

FYI Firefox is shipping Temporal in version 139, planned to be released at the end of May.

MeesterDev avatar Apr 28 '25 08:04 MeesterDev

Firefox shipped the Temporal support and it has been out for a few months now. Would be great to get these types unless the condition for entering lib is cross-browser support, which it looks like we will have to wait a bit longer for: https://caniuse.com/temporal

TomasHubelbauer avatar Oct 18 '25 18:10 TomasHubelbauer