mirror of
https://github.com/r-freeman/portfolio.git
synced 2025-04-21 23:54:37 +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 {Views} from '@/components/ui/Views'
|
||||||
import {Resume} from '@/components/ui/Resume'
|
import {Resume} from '@/components/ui/Resume'
|
||||||
import {getAllArticles} from '@/lib/getAllArticles'
|
import {getAllArticles} from '@/lib/getAllArticles'
|
||||||
import {formatDate} from '@/lib/formatDate'
|
|
||||||
import type {Article} from '@/types'
|
import type {Article} from '@/types'
|
||||||
import {metadata as _metadata} from '@/lib/generateMetadata'
|
import {metadata as _metadata} from '@/lib/generateMetadata'
|
||||||
import {SimpleLayout} from '@/components/layouts/SimpleLayout'
|
import {SimpleLayout} from '@/components/layouts/SimpleLayout'
|
||||||
|
import {format} from 'date-fns'
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: 'Ryan Freeman - Full-stack software engineer based in Dublin, Ireland.',
|
title: 'Ryan Freeman - Full-stack software engineer based in Dublin, Ireland.',
|
||||||
@ -45,7 +45,7 @@ function Article(article: Article) {
|
|||||||
</Card.Title>
|
</Card.Title>
|
||||||
<p className="flex order-first space-x-1 z-10 mb-3">
|
<p className="flex order-first space-x-1 z-10 mb-3">
|
||||||
<Card.Eyebrow as="time" dateTime={article.date} decorate={false}>
|
<Card.Eyebrow as="time" dateTime={article.date} decorate={false}>
|
||||||
{formatDate(article.date)}
|
{format(article.date, 'd MMMM yyyy')}
|
||||||
</Card.Eyebrow>
|
</Card.Eyebrow>
|
||||||
<Views
|
<Views
|
||||||
slug={article.slug}
|
slug={article.slug}
|
||||||
|
@ -2,10 +2,10 @@ import React from 'react'
|
|||||||
import {SimpleLayout} from '@/components/layouts/SimpleLayout'
|
import {SimpleLayout} from '@/components/layouts/SimpleLayout'
|
||||||
import {Card} from '@/components/ui/Card'
|
import {Card} from '@/components/ui/Card'
|
||||||
import {Views} from '@/components/ui/Views'
|
import {Views} from '@/components/ui/Views'
|
||||||
import {formatDate} from '@/lib/formatDate'
|
|
||||||
import {getAllArticles} from '@/lib/getAllArticles'
|
import {getAllArticles} from '@/lib/getAllArticles'
|
||||||
import {metadata as _metadata} from '@/lib/generateMetadata'
|
import {metadata as _metadata} from '@/lib/generateMetadata'
|
||||||
import type {Article} from '@/types'
|
import type {Article} from '@/types'
|
||||||
|
import {format} from 'date-fns'
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: 'Writing',
|
title: 'Writing',
|
||||||
@ -42,7 +42,7 @@ function Article({article}: { article: Article }) {
|
|||||||
</Card.Title>
|
</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">
|
<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}>
|
<Card.Eyebrow as="time" dateTime={article.date} decorate={false}>
|
||||||
{formatDate(article.date)}
|
{format(article.date, 'd MMMM yyyy')}
|
||||||
</Card.Eyebrow>
|
</Card.Eyebrow>
|
||||||
<Views
|
<Views
|
||||||
slug={article.slug}
|
slug={article.slug}
|
||||||
|
@ -4,11 +4,11 @@ import {Container} from '@/components/common/Container'
|
|||||||
import {Prose} from '@/components/ui/Prose'
|
import {Prose} from '@/components/ui/Prose'
|
||||||
import {Views} from '@/components/ui/Views'
|
import {Views} from '@/components/ui/Views'
|
||||||
import {ArrowDownIcon} from '@/components/icons/ArrowDownIcon'
|
import {ArrowDownIcon} from '@/components/icons/ArrowDownIcon'
|
||||||
import {formatDate} from '@/lib/formatDate'
|
|
||||||
import ArticleNav from '@/components/ui/ArticleNav'
|
import ArticleNav from '@/components/ui/ArticleNav'
|
||||||
import Comments from '@/components/ui/Comments'
|
import Comments from '@/components/ui/Comments'
|
||||||
import {getAllArticles} from '@/lib/getAllArticles'
|
import {getAllArticles} from '@/lib/getAllArticles'
|
||||||
import {getComments} from '@/lib/getComments'
|
import {getComments} from '@/lib/getComments'
|
||||||
|
import {format} from 'date-fns'
|
||||||
|
|
||||||
type ArticleLayout = {
|
type ArticleLayout = {
|
||||||
title: string
|
title: string
|
||||||
@ -76,7 +76,7 @@ export async function ArticleLayout({
|
|||||||
</h1>
|
</h1>
|
||||||
<p className="order-first text-base text-zinc-500 dark:text-zinc-400">
|
<p className="order-first text-base text-zinc-500 dark:text-zinc-400">
|
||||||
<time dateTime={date}>
|
<time dateTime={date}>
|
||||||
<span>{formatDate(date)}</span>
|
<span>{format(date, 'd MMMM yyyy')}</span>
|
||||||
</time>
|
</time>
|
||||||
<Views slug={slug} title={title} shouldUpdateViews={true}/>
|
<Views slug={slug} title={title} shouldUpdateViews={true}/>
|
||||||
</p>
|
</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…
x
Reference in New Issue
Block a user