Format dates properly

This commit is contained in:
Kamran Ahmed
2019-11-06 23:08:39 +04:00
parent 09309dfef7
commit f188ef4296
5 changed files with 23 additions and 14 deletions

View File

@@ -1,3 +1,4 @@
import formatDate from 'date-fns/format'
import {
ActionItems,
AuthorImage,
@@ -25,7 +26,7 @@ const GuideHeader = ({
{ author.name }
</GuideAuthor>
&middot;
<GuideDate>{ guide.createdAt }</GuideDate>
<GuideDate>{ formatDate(new Date(guide.createdAt), 'EEEE, MMMM d yyyy') }</GuideDate>
&middot;
<EditGuide href={ getContributionUrl(guide) } target="_blank">Improve this Guide</EditGuide>
</GuideMeta>