From d5e71ba2209af8a741aec235044effd32576b2ba Mon Sep 17 00:00:00 2001 From: Wongspatt Pasadhika <94737324+uno-p-5@users.noreply.github.com> Date: Wed, 24 Apr 2024 22:23:51 -0700 Subject: [PATCH] maybe i should just pull the repo and test locally --- components/search/Blurb.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/search/Blurb.tsx b/components/search/Blurb.tsx index 6f19814..06db4f7 100644 --- a/components/search/Blurb.tsx +++ b/components/search/Blurb.tsx @@ -17,10 +17,10 @@ const Blurb = (props: BlurbProps) => { const [timeAgo, setTimeAgo] = useState(""); useEffect(() => { - const getTimeAgo = (date) => { + const getTimeAgo = (date: number) => { const now = new Date(); const updatedDate = new Date(date); - const diff = now - updatedDate; + const diff = now.getTime() - updatedDate.getTime(); const seconds = Math.floor((diff / 1000) % 60); const minutes = Math.floor((diff / 1000 / 60) % 60);