mirror of
https://github.com/denoland/deno.git
synced 2024-12-25 08:39:09 -05:00
25aed5071f
Adds a temporary polyfill for `Duration.prototype.toLocaleString()` that will be removed once native support in V8 lands.
14 lines
463 B
TypeScript
14 lines
463 B
TypeScript
console.log(Temporal.Now.timeZoneId());
|
|
// @ts-expect-error: undefined check
|
|
console.log(Temporal.Now.timeZone);
|
|
|
|
const zoned = new Temporal.ZonedDateTime(0n, "UTC");
|
|
console.log(zoned.calendarId);
|
|
console.log(zoned.timeZoneId);
|
|
// @ts-expect-error: undefined check
|
|
console.log(zoned.calendar);
|
|
// @ts-expect-error: undefined check
|
|
console.log(zoned.timeZone);
|
|
|
|
const duration = Temporal.Duration.from("P1DT6H30M");
|
|
console.log(duration.toLocaleString("en-US"));
|