Formatting Relative Time with JavaScript's RelativeTimeFormat Constructor

added by JavaScript Kicks
1/7/2020 11:38:50 AM

282 Views

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.


0 comments