Unverified Commit 49f3a24d authored by Gary van Woerkens's avatar Gary van Woerkens Committed by GitHub
Browse files

fix: Display date instead of duration in post info. (#291)

parent 72886177
......@@ -3,9 +3,18 @@ import React from "react"
moment.locale("fr")
const Publication = ({ date }) => {
const now = moment()
const publicationDate = moment(date)
return now.diff(publicationDate, "days") + 1 > 15
? `le ${publicationDate.format("DD/MM/YYYY")}`
: publicationDate.fromNow()
}
const Info = ({ post }) => (
<div className="info">
Publié {moment(post.created_at).fromNow()}
Publié <Publication date={post.created_at} />
{post.author && (
<>
&nbsp;par&nbsp;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment