added time to post
This commit is contained in:
@@ -40,6 +40,11 @@ const Post = ({ post, recursionDepth, selectPost, reload }) => {
|
||||
return nrOfComments;
|
||||
}
|
||||
|
||||
const getDate = (dateStr) => {
|
||||
let date = new Date(dateStr);
|
||||
return date.toLocaleDateString('de-DE') + "\n" + ("00" + date.getHours()).slice(-2) + ":" + ("00" + date.getMinutes()).slice(-2);
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="post" onClick={click => {if (!(click.target instanceof HTMLButtonElement)) setShowComments(!showComments)}}>
|
||||
@@ -57,7 +62,8 @@ const Post = ({ post, recursionDepth, selectPost, reload }) => {
|
||||
</div>}
|
||||
<div className="post-right">
|
||||
<div className="post-date">
|
||||
{post.date.slice(8, 10) + "." + post.date.slice(5, 7) + "." + post.date.slice(0, 4)}
|
||||
|
||||
{getDate(post.date)}
|
||||
</div>
|
||||
<div className="row">
|
||||
<div className="votes">
|
||||
|
||||
Reference in New Issue
Block a user