2020.615.0 • Published 4 years ago
@thatiemsz/tc39-temporal v2020.615.0
Temporal
Polyfill for the Temporal proposal in ECMAScript. (includes TypesScript typings)
Reference documentation can be found here.
Installation
Install via Node.js:
npm install @ThaTiemsz/tc39-temporal
Usage
const { Temporal } = require("temporal");
const dateTime = Temporal.now.dateTime();
dateTime.toString(); // 2020-05-15T17:52:07.534927511
const legacyDate = new Date();
const absolute = Temporal.Absolute.fromEpochMilliseconds(legacyDate.getTime());
absolute.toString(); // 2020-05-15T15:52:07.543Z
const absoluteTime = Temporal.Absolute.from("2020-01-03T10:41:51Z");
absoluteTime.toString("Asia/Tokyo"); // 2020-01-03T19:41:51+09:00[Asia/Tokyo]
const nextWeek = dateTime.plus({ days: 3 });
nextWeek.toString(); // 2020-05-22T17:52:07.534927511
2020.615.0
4 years ago
2020.613.0
4 years ago
2020.612.0
4 years ago
2020.608.0
4 years ago
2020.605.0
4 years ago
2020.529.1
4 years ago