Closed ubersan closed 2 months ago
You're probably looking for Intl.DurationFormat
. We'll likely add support to next-intl
once this API has reasonably good support in JS runtimes, in the meantime you can consider using a polyfill.
I've added this to the list in https://github.com/amannn/next-intl/issues/774 in order to track support for this, many thanks for the report!
ah I see, thanks, I will check it out!
Is your feature request related to a problem? Please describe.
I would like to display the duration, i.e. distance between two dates. It seems that currently the closest match is the
relativeTime
, however this returns the a) the duration with theago
suffix and b) for small durations doesn't display the number, but already sth likeNow
/Just now
.I tried to check the docs and options, but didn't find a way to achieve this result with the current API
Describe the solution you'd like
I would like to have something like the following
Describe alternatives you've considered
Alternatively also an option for the existing
relativeTime
could be considered, such as