tc39 / proposal-temporal
- суббота, 13 марта 2021 г. в 00:29:22
Provides standard objects and functions for working with dates and times.
Provides standard objects and functions for working with dates and times.
NOTE: The Polyfill, specification text and documentation are under review and should be understood to be unstable.
This proposal is currently Stage 2.
At the time of writing, all the major design decisions that we are aware of have been made. The proposal is under review by the TC39 delegates and the bar for making subsequent changes is high. Nonetheless, changes may occur as the result of feedback from TC39 reviews and implementation in JS engines.
Stage 3 Reviewers:
Date
has been a long-standing pain point in ECMAScript.
This proposes Temporal
, a global Object
that acts as a top-level namespace (like Math
), that brings a modern date/time API to the ECMAScript language.
For a detailed breakdown of motivations, see:
Fixing JavaScript Date
The specification text can be found here.
A complete polyfill can be found here. When viewing the reference documentation, the polyfill is automatically loaded in your browser, so you can try it out by opening your browser's developer tools.
NOTE: We encourage you to experiment with the polyfill, but don't use it in production! The API may change before the proposal reaches Stage 3.
Reference documentation and examples can be found here.
A cookbook to help you get started and learn the ins and outs of Temporal is available here