feat: replace timeago with dayjs
All checks were successful
renovate / renovate (push) Successful in 49s
test-build / guarddog (push) Successful in 1m8s
test-build / build (push) Successful in 3m24s

This commit is contained in:
2026-03-12 12:35:23 -05:00
parent 5b6b6e479f
commit 405fdf297c
5 changed files with 19 additions and 34 deletions

View File

@@ -55,7 +55,7 @@ const { slug, title, description, logoLight, logoDark, count, publishDate } = As
</svg>
{count}
</span>
<span class="inline-flex items-center">
<div class="inline-flex items-center">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
@@ -68,8 +68,10 @@ const { slug, title, description, logoLight, logoDark, count, publishDate } = As
<circle cx="12" cy="12" r="10"></circle>
<polyline points="12 6 12 12 16 14"></polyline>
</svg>
{publishDate}
</span>
<span>
{publishDate}
</span>
</div>
</div>
</div>
</div>

View File

@@ -6,7 +6,7 @@ import type { Post } from '@lib/directusTypes';
import CategoryCard from '@components/cards/CategoryCard.astro';
import LargeCategoryCard from '@components/cards/LargeCategoryCard.astro';
import directus from '@lib/directus';
import { timeago } from '@support/time';
import { formatFromNow } from '@support/time';
const global = await directus.request(readSingleton('site_global'));
@@ -93,7 +93,7 @@ const categories = (await directus.request(readItems('categories')))
logoLight={category.logoLight}
logoDark={category.logoDark}
count={postMap.get(category.slug)?.length ?? 0}
publishDate={timeago(postMap.get(category.slug)?.[0]?.published_date)}
publishDate={formatFromNow(postMap.get(category.slug)?.[0]?.published_date)}
/>
</div>
);
@@ -106,7 +106,7 @@ const categories = (await directus.request(readItems('categories')))
logoLight={global.all_logoLight}
logoDark={global.all_logoDark}
count={posts.length}
publishDate={timeago(posts[0]?.published_date)}
publishDate={formatFromNow(posts[0]?.published_date)}
/>
</div>
</div>