Formatting Relative Time with JavaScript’s RelativeTimeFormat Constructor
Published in
6 min readJan 6, 2020
With the Intl.RelativeTimeFormat
constructor, we can format relative time in a locale sensitive manner with ease. We can style in different ways and format it the manner we want. This lets us format relative time strings without the hassle that comes from manipulating strings. The constructor takes 2 arguments. The first argument is a locale string or an array of…