ECMAScript Temporal is the new date and time API for ECMAScript. Because ECMAScript is designed for global audiences, high-quality internationalization is a design goal. This document discusses why and how calendar systems are included in the Temporal API, explains problems we expect developers to encounter with calendars, and outlines how to avoid those problems. A final… Continue reading Temporal : Supporting Calendar Systems in Temporal
Tag: temporal
Temporal : Temporal.Calendar
A Temporal.Calendar is a representation of a calendar system. It includes information about how many days are in each year, how many months are in each year, how many days are in each month, and how to do arithmetic in that calendar system. Much of the world uses the Gregorian calendar, which was invented in 1582 C.E. On… Continue reading Temporal : Temporal.Calendar
Temporal: Duration Balancing
Duration Balancing With most types in Temporal, each unit has a natural maximum. For example, there is no such time as 11:87, so when creating a Temporal.PlainTime from 11:87 the time is either clipped to 11:59 (“constrain” mode) or an exception is thrown (“reject” mode). With Temporal.Duration, however, maximums are less clear-cut. Take, for example, a duration of… Continue reading Temporal: Duration Balancing
Temporal : Time Zones and Resolving Ambiguity
Understanding Clock Time vs. Exact Time The core concept in Temporal is the distinction between wall-clock time (also called “local time” or “clock time”) which depends on the time zone of the clock and exact time (also called “UTC time”) which is the same everywhere. Wall-clock time is controlled by local governmental authorities, so it can abruptly change. When… Continue reading Temporal : Time Zones and Resolving Ambiguity
Temporal : Cookbook
Running the cookbook files Running cookbook files: see instructions in ../polyfill/README.md Frequently Asked Questions These are some of the most common tasks that people ask questions about on StackOverflow with legacy Date. Here’s how they would look using Temporal. Current date and time How to get the current date and time in the local time zone? /** *… Continue reading Temporal : Cookbook
Temporal : General Overview
Introduction Date has been a long-standing pain point in ECMAScript. This is a proposal for 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 look at some of the problems with Date, and the motivations for Temporal, see: Fixing JavaScript Date. Temporal fixes these problems by:… Continue reading Temporal : General Overview
Temporal Date : Practical Guide
Working with dates in JavaScript sucks. The Date API is extremely clunky, has almost no methods that respect immutability, and is overall just bad. If you are still not convinced that dates in JavaScript are bad then this fact will change your mind. Months in JavaScript start at 0, but days of the month start… Continue reading Temporal Date : Practical Guide