svelte-time
svelte-time copied to clipboard
Switching format after an amount of time
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'.
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})`} />