From c85eeccd4c430a50aaeaf2085eed9017a140ee66 Mon Sep 17 00:00:00 2001 From: Clayton Wilson Date: Thu, 5 Dec 2019 21:16:46 -0500 Subject: [PATCH] Display formatted time on otherUser page --- twistter-frontend/src/pages/otherUser.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/twistter-frontend/src/pages/otherUser.js b/twistter-frontend/src/pages/otherUser.js index 3832b8c..14b3b40 100644 --- a/twistter-frontend/src/pages/otherUser.js +++ b/twistter-frontend/src/pages/otherUser.js @@ -205,6 +205,11 @@ class user extends Component { }); } + formatDate(dateString) { + let newDate = new Date(Date.parse(dateString)); + return newDate.toDateString(); + } + render() { const { classes } = this.props; @@ -283,7 +288,7 @@ class user extends Component { {post.userHandle} - {post.createdAt} + {this.formatDate(post.createdAt)}