tempo icon indicating copy to clipboard operation
tempo copied to clipboard

Feature Request: Relative Time

Open saturnonearth opened this issue 1 year ago • 3 comments
trafficstars

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

saturnonearth avatar Feb 15 '24 17:02 saturnonearth

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.

melv-n avatar Feb 16 '24 07:02 melv-n

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.

justin-schroeder avatar Feb 19 '24 17:02 justin-schroeder

The versatility and ergonomics of javascript-time-ago, especially their Custom config, are worth looking into for inspiration.

maninak avatar Mar 27 '24 14:03 maninak