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

Fuzzy time

Open khromov opened this issue 2 years ago • 2 comments

Hi! Would it be possible to add just a tiny bit of "fuzzy" time display as an option. For my use case I'm server rendering the timestamps so instead of saying "12 seconds ago" without updating I'd like anything under 1-2 minutes to say just now for example. Perhaps if this is outside the scope of the library you could pass a custom formatting function that could optionally override the default display?

khromov avatar Jul 11 '23 22:07 khromov

It's probably doable, I imagine an option to override any time within a certain threshold to be "now" would do it, and that threshold would default to 0 to get normal (current) behavior.

CaptainCodeman avatar Jul 11 '23 23:07 CaptainCodeman

You could do that in the calling code as well of course.

CaptainCodeman avatar Jul 11 '23 23:07 CaptainCodeman