1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 12:46:38 -04:00

dayjs ➡️ date-fns

This commit is contained in:
2025-03-21 13:20:42 -04:00
parent 9fd3de8569
commit 8890c1d08d
9 changed files with 57 additions and 60 deletions

View File

@ -87,7 +87,7 @@ const Page = async ({ params }: { params: Promise<{ slug: string }> }) => {
<div className={styles.metaItem}>
<Link href={`/notes/${frontmatter.slug}` as Route} plain className={styles.metaLink}>
<CalendarIcon size="1.2em" className={styles.metaIcon} />
<Time date={frontmatter.date} format="MMMM D, YYYY" />
<Time date={frontmatter.date} format="MMMM d, y" />
</Link>
</div>

View File

@ -38,7 +38,7 @@ const Page = async () => {
<ul className={styles.list}>
{posts.map(({ slug, date, title, htmlTitle }) => (
<li className={styles.post} key={slug}>
<Time date={date} format="MMM D" className={styles.postDate} />
<Time date={date} format="MMM d" className={styles.postDate} />
<span>
<Link href={`/notes/${slug}` as Route} dangerouslySetInnerHTML={{ __html: htmlTitle || title }} />
</span>

View File

@ -152,9 +152,8 @@ const Page = async () => {
</div>
)}
{/* only use relative "time ago" on client side, since it'll be outdated via SSG and cause hydration errors */}
<div className={styles.metaItem}>
<RelativeTime date={repo.updatedAt} verb="Updated" staticFormat="MMM D, YYYY" />
Updated <RelativeTime date={repo.updatedAt} />
</div>
</div>
</div>