Intl.DateTimeFormat
dateStyle / timeStyle
For Stage 4
Champions:
Zibi Braniecki (Mozilla)
Reviewers:
Frank Tang (Google)
Nathan Hammond (Ember)
Motivation
Options Bag
let dtf = new Intl.DateTimeFormat("pl", {
year: "numeric", // "numeric", "2-digit"
month: "short", // "short", "numeric", "2-digit"
day: "numeric", // "numeric", "2-digit"
});
console.log(dtf.format(date)); // "18 lip 2020"
dateStyle
let dtf = new Intl.DateTimeFormat("pl", {
dateStyle: "medium", // "full", "long", "medium" or "short"
});
console.log(dtf.format(date)); // "18 lip 2020"
timeStyle
let dtf = new Intl.DateTimeFormat("pl", {
timeStyle: "medium", // "full", "long", "medium" or "short"
});
console.log(dtf.format(date)); // "18:40:42"
dateStyle + timeStyle
let dtf = new Intl.DateTimeFormat("pl", {
dateStyle: "long", // "full", "long", "medium" or "short"
timeStyle: "short", // "full", "long", "medium" or "short"
});
console.log(dtf.format(date)); // "18 lipca 2020 18:42"
Current Status
Plans for v2
Requesting the Committee Approval for advancement to Stage 4