Have you heard of Temporal? It's an ECMAScript proposal currently at stage 3. It 'brings a modern date/time API to the ECMAScript language':
Date
has been a long-standing pain point inECMAScript
. This proposesTemporal
, a globalObject
that acts as a top-level namespace (likeMath
), that brings a modern date/time API to theECMAScript
language. For a detailed breakdown of motivations, see: Fixing JavaScript DateTemporal fixes these problems by:
- Providing easy-to-use APIs for date and time computations
- First-class support for all time zones, including DST-safe arithmetic
- Dealing only with objects representing fixed dates and times
- Parsing a strictly specified string format
- Supporting non-Gregorian calendars
The whole documentation is here. It seems like a very interesting proposal and this might make libraries like Moment irrelevant.
Top comments (0)