svelte-time-distance Svelte Themes

Svelte Time Distance

Svelte component to display time distances in a human readable format.

Time Distance

Display time distances in a human readable format.

  • Based on date-fns
  • Updates every 60 seconds

View demo

Usage

Install package:

pnpm i -D svelte-time-distance

Add to your UI:

<!-- Example.svelte -->
<script>
  import { TimeDistance } from 'svelte-time-distance'

  let timestamp = new Date()
</script>

<TimeDistance {timestamp} class="jumbo" />

License

MIT

Top categories

Loading Svelte Themes