diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2023-07-15 20:22:10 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2023-07-15 20:22:10 -0400 |
| commit | 8c1cf540c998d554b10282292edeb28b74349297 (patch) | |
| tree | 1553070a4c5b6a555b96c71a98b4b5406dd87c76 /components | |
| parent | f4abb8200e49024311d9fd8f5130ed189e139fe3 (diff) | |
| download | alure-website-8c1cf540c998d554b10282292edeb28b74349297.tar.gz alure-website-8c1cf540c998d554b10282292edeb28b74349297.tar.bz2 alure-website-8c1cf540c998d554b10282292edeb28b74349297.zip | |
Getting ready to properly add travel advisory; Added additional cities
Diffstat (limited to 'components')
| -rw-r--r-- | components/DateFormatter.js | 9 | ||||
| -rw-r--r-- | components/PostPreview.js | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/components/DateFormatter.js b/components/DateFormatter.js new file mode 100644 index 0000000..11f3bf3 --- /dev/null +++ b/components/DateFormatter.js @@ -0,0 +1,9 @@ + +import { parseISO, format } from 'date-fns' + +const DateFormatter = (dateString) => { + const date = parseISO(dateString) + return <time dateTime={dateString}>{format(date, 'LLLL d, yyyy')}</time> +} + +export default DateFormatter
\ No newline at end of file diff --git a/components/PostPreview.js b/components/PostPreview.js index 6eca000..083bf2b 100644 --- a/components/PostPreview.js +++ b/components/PostPreview.js @@ -1,8 +1,9 @@ import Link from "next/link"; +//import DateFormatter from '@/components/DateFormatter' export default function PostPreview(props) { return ( - <div key="post" className="py-2 bg-zinc-800 py-3 px-5 border border-gray-600 rounded-lg space-y-3"> + <div key="post" className="bg-zinc-800 py-3 px-5 border border-gray-600 rounded-lg space-y-3"> <Link href={`/updates/${props.slug}`}> <h2 className="font-medium text-2xl hover:underline">{props.title}</h2> </Link> |
