From 0b0ff73e6d8b5eaf5c8d394fa4ef71fa999bf484 Mon Sep 17 00:00:00 2001 From: Vanessa Lai <159257119+vanesssalai@users.noreply.github.com> Date: Sat, 13 Jul 2024 15:29:52 +0800 Subject: [PATCH] fixed date bug on forum card --- src/components/forumcards/ForumCards.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/forumcards/ForumCards.jsx b/src/components/forumcards/ForumCards.jsx index 1874a0d..f978ba7 100644 --- a/src/components/forumcards/ForumCards.jsx +++ b/src/components/forumcards/ForumCards.jsx @@ -9,7 +9,7 @@ import { db } from '../../lib/firebaseConfig'; import './ForumCards.css'; function timeSincePost(postDate) { - const now = new Date().toISOString(); + const now = new Date(); const posted = new Date(postDate); const diffInSeconds = Math.floor((now - posted) / 1000); @@ -403,4 +403,4 @@ function ForumCards({ forumDetail, descriptionLength = 200 }) { ); } -export default ForumCards; \ No newline at end of file +export default ForumCards;