mirror of
https://github.com/r-freeman/portfolio.git
synced 2025-04-11 20:54:31 +00:00
Remove date helper function
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 3m10s
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 3m10s
This commit is contained in:
parent
907da404b2
commit
dae3c59c81
@ -3,10 +3,10 @@ import {Card} from '@/components/ui/Card'
|
||||
import {Views} from '@/components/ui/Views'
|
||||
import {Resume} from '@/components/ui/Resume'
|
||||
import {getAllArticles} from '@/lib/getAllArticles'
|
||||
import {formatDate} from '@/lib/formatDate'
|
||||
import type {Article} from '@/types'
|
||||
import {metadata as _metadata} from '@/lib/generateMetadata'
|
||||
import {SimpleLayout} from '@/components/layouts/SimpleLayout'
|
||||
import {format} from 'date-fns'
|
||||
|
||||
const meta = {
|
||||
title: 'Ryan Freeman - Full-stack software engineer based in Dublin, Ireland.',
|
||||
@ -45,7 +45,7 @@ function Article(article: Article) {
|
||||
</Card.Title>
|
||||
<p className="flex order-first space-x-1 z-10 mb-3">
|
||||
<Card.Eyebrow as="time" dateTime={article.date} decorate={false}>
|
||||
{formatDate(article.date)}
|
||||
{format(article.date, 'd MMMM yyyy')}
|
||||
</Card.Eyebrow>
|
||||
<Views
|
||||
slug={article.slug}
|
||||
|
@ -2,10 +2,10 @@ import React from 'react'
|
||||
import {SimpleLayout} from '@/components/layouts/SimpleLayout'
|
||||
import {Card} from '@/components/ui/Card'
|
||||
import {Views} from '@/components/ui/Views'
|
||||
import {formatDate} from '@/lib/formatDate'
|
||||
import {getAllArticles} from '@/lib/getAllArticles'
|
||||
import {metadata as _metadata} from '@/lib/generateMetadata'
|
||||
import type {Article} from '@/types'
|
||||
import {format} from 'date-fns'
|
||||
|
||||
const meta = {
|
||||
title: 'Writing',
|
||||
@ -42,7 +42,7 @@ function Article({article}: { article: Article }) {
|
||||
</Card.Title>
|
||||
<p className="flex order-first space-x-1 z-10 mb-3 md:mb-0 md:ml-4 md:order-last flex-shrink-0">
|
||||
<Card.Eyebrow as="time" dateTime={article.date} decorate={false}>
|
||||
{formatDate(article.date)}
|
||||
{format(article.date, 'd MMMM yyyy')}
|
||||
</Card.Eyebrow>
|
||||
<Views
|
||||
slug={article.slug}
|
||||
|
@ -4,11 +4,11 @@ import {Container} from '@/components/common/Container'
|
||||
import {Prose} from '@/components/ui/Prose'
|
||||
import {Views} from '@/components/ui/Views'
|
||||
import {ArrowDownIcon} from '@/components/icons/ArrowDownIcon'
|
||||
import {formatDate} from '@/lib/formatDate'
|
||||
import ArticleNav from '@/components/ui/ArticleNav'
|
||||
import Comments from '@/components/ui/Comments'
|
||||
import {getAllArticles} from '@/lib/getAllArticles'
|
||||
import {getComments} from '@/lib/getComments'
|
||||
import {format} from 'date-fns'
|
||||
|
||||
type ArticleLayout = {
|
||||
title: string
|
||||
@ -76,7 +76,7 @@ export async function ArticleLayout({
|
||||
</h1>
|
||||
<p className="order-first text-base text-zinc-500 dark:text-zinc-400">
|
||||
<time dateTime={date}>
|
||||
<span>{formatDate(date)}</span>
|
||||
<span>{format(date, 'd MMMM yyyy')}</span>
|
||||
</time>
|
||||
<Views slug={slug} title={title} shouldUpdateViews={true}/>
|
||||
</p>
|
||||
|
@ -1,8 +0,0 @@
|
||||
export function formatDate(dateString: string) {
|
||||
return new Date(`${dateString}`).toLocaleDateString('en-IE', {
|
||||
day: 'numeric',
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
timeZone: 'UTC'
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue
Block a user