Use date helper function

This commit is contained in:
Ella 2022-12-28 21:15:30 -05:00
parent 77fcd834b7
commit 2194b33730

View file

@ -16,6 +16,7 @@ import { useState, useEffect } from 'react'
import Buttons from './button'
import ScrollingHackathons from '../../hackathons/scrolling-hackathons'
import Dot from '../../dot'
import { formatDate } from '../../../lib/dates'
/** @jsxImportSource theme-ui */
const Cover = () => (
@ -181,11 +182,7 @@ export default function Hackathons({ data, stars }) {
</Box>
)}
<Link href={data.website}>
{data.name} |{' '}
{new Intl.DateTimeFormat('en-US', { month: 'long' }).format(
new Date(data.start)
)}{' '}
{new Date(data.start).getUTCDate()}
{data.name} | {formatDate('mmmm d', new Date(data.start))}
</Link>
</Box>
))}