svelte-time icon indicating copy to clipboard operation
svelte-time copied to clipboard

Switching format after an amount of time

Open omar2205 opened this issue 2 years ago • 1 comments

I want to use the relative time, 'a minute ago', but after a couple of hours, I want to switch it to say `04:40 am'.

omar2205 avatar Dec 25 '21 03:12 omar2205

This would also be useful for customizing a formatted date to also include the relative timestamp.

Jan. 2020 (2 years ago)

The API could look like:

<Time format="MM. YYYY" display={({ relative, formatted }) => `${formatted} (${relative})`} />

metonym avatar Jan 20 '22 23:01 metonym