Closed damianobarbati closed 5 years ago
Hi! In the initial designs, we considered taking a Date object instead of a numeric value and use bestFit
style to return something like what you show here, but these challenges prevented us to move into that direction.
@rxaviers thanks for the clarification! Thus the Intl.RelativeTimeFormat is currently primarily intended as support for libraries rather then for direct use in cases like mine.
Correct. Libraries should fill in the higher level abstractions.
@damianobarbati - Rafael also wrote a small library that can be used on top of the core API to handle discrete units - https://github.com/rxaviers/relative-time/
We use it in Firefox and it works great!
OK, seems like this question has been answered.
I was attempting to move from
momentjs
and similia but it's pretty hard since all the logic is given to the developer.Cit:
Could something like the ever make its way to the spec?