-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c9d601
commit a8c6dfd
Showing
7 changed files
with
52 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
import React, { FC } from "react"; | ||
import { parseISO, format } from "date-fns"; | ||
|
||
export default function Date({ dateString }: { dateString: string }) { | ||
const date = parseISO(dateString); | ||
return <time dateTime={dateString}>{format(date, "LLLL d, yyyy")}</time>; | ||
} | ||
type DateProps = { | ||
dateString: string; | ||
}; | ||
|
||
const Date: FC<DateProps> = ({ dateString }) => ( | ||
<time dateTime={dateString}> | ||
{format(parseISO(dateString), "LLLL d, yyyy")} | ||
</time> | ||
); | ||
|
||
export default Date; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
type MatterData = matter.GrayMatterFile<string> & { | ||
id: string; | ||
type PostData = matter.GrayMatterFile<string> & { | ||
date: string; | ||
title: string; | ||
id?: string; | ||
contentHtml?: string; | ||
}; |