tempo
tempo copied to clipboard
Feature Request: Relative Time
Would love to see a "format relative time" helper, like date-fns
See: https://github.com/date-fns/date-fns/blob/f4e22da16/src/formatRelative/index.ts#L54
I was looking for a "1 hour ago" relative time formatter as well in the (great) documentation and surprised it wasn't there. Adding this would make this even more powerful and complete.
I would love this too — although the native relative time format is already quite good:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat
Perhaps tempo could offer pure syntactic sugar around this call.
The versatility and ergonomics of javascript-time-ago, especially their Custom config, are worth looking into for inspiration.