metonym / svelte-time

Svelte component and action to format a timestamp using day.js
https://metonym.github.io/svelte-time
MIT License
137 stars 8 forks source link

Locale options? #2

Closed dotslashf closed 3 years ago

dotslashf commented 3 years ago

I think it's better to add locale options considering dayjs already have it, so other timezone can use relative time format too.

Thanks!^^

metonym commented 3 years ago

Per the dayjs documentation, a custom locale can be imported and set as the default locale. I've updated the docs to reflect this.

<script>
  import "dayjs/esm/locale/de";
  import dayjs from "dayjs/esm";

  dayjs.locale("de"); // German locale
</script>