JavaScript Intl in ECMAScript 2020

There are some great enhancements coming to JavaScript’s Internationalisation API in ECMAScript 2020, like Intl.RelativeTimeFormat:

const rtf = new Intl.RelativeTimeFormat("en", {
localeMatcher: "best fit",
numeric: "always",
style: "long",
});
// Format relative time using negative value (-1).
rtf.format(-1, "day");
// > "1 day ago"
// Format relative time using positive value (1).
rtf.format(1, "day");
// > "in 1 day"

A full list with examples is available at https://diary.braniecki.net/2020/02/14/js-intl-in-2020/.