diff --git a/src/lib/CollectionList.svelte b/src/lib/components/CollectionList.svelte similarity index 84% rename from src/lib/CollectionList.svelte rename to src/lib/components/CollectionList.svelte index 1fab9534..b042997c 100644 --- a/src/lib/CollectionList.svelte +++ b/src/lib/components/CollectionList.svelte @@ -6,16 +6,8 @@ export let aspect = "aspect-square"; export let size = "normal"; - import { format, addDays } from 'date-fns'; import SvelteMarkdown from 'svelte-markdown'; - - function formateItemDate (item) { - let dt = format(new Date(item.date), "MMMM d") - if (item.days > 1) { - dt += "-" + format(addDays(new Date(item.date), item.days-1), "d") - } - return dt - } + import { formatItemDate } from '$lib/utils.js'; const _url = (col, item) => `/${entry}/${col}/${item.id}` @@ -39,7 +31,7 @@