Skip to content

Commit

Permalink
fix: format date
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Jan 12, 2024
1 parent 14c5eec commit 5fbc87c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pages/blog/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function BlogPost({ page }: InferGetStaticPropsType<typeof getSta
<span>{data.category}</span>
</span>
<p className='pt-2 text-xs font-medium'>
{data.date}
{new Date(data.date).toLocaleDateString('en')}
<br />
{data.author}
</p>
Expand Down
2 changes: 1 addition & 1 deletion pages/blog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function Blog(props: InferGetStaticPropsType<typeof getStaticProp
</h2>
<p className='text-sm text-gray-500'>{page.teaser}</p>
<p className='pt-2 text-xs font-medium'>
{page.author} · <span className='mx-1'>{page.date}</span>
{page.author} · <span className='mx-1'>{new Date(page.date ?? new Date()).toLocaleDateString('en')}</span>
</p>
</div>
))}
Expand Down

0 comments on commit 5fbc87c

Please sign in to comment.