Using Intl.DurationFormat for Localized Durations

Last year I had the opportunity to give a talk on the web platform’s Intl specification. This made me incredibly happy because in preparing for the presentation, I discovered so many cool features and capabilities of the spec that I had no idea existed. Almost a year ago, I wrote up a blog post on Intl.RelativeTimeFormat, talking about how the API was easy to use, but perhaps a bit difficult when dealing when determining the best values to use when formatting dynamic dates. Today, I’m going to turn my attention to a related spec, Intl.DurationFormat The Basics The DurationFormat API works like so: Given a locale (defaulting to the browser’s locale) Given a set of values representing... more →
Posted in: JavaScript