From f9338ce8e11d1c31fe1df706dfa3e892e321ba9d Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Wed, 26 Mar 2025 16:52:15 +0100 Subject: [PATCH] fix: remove past time prefix from Time component --- src/components/primitives/Time.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/primitives/Time.tsx b/src/components/primitives/Time.tsx index d64883f25..eb33e1f98 100644 --- a/src/components/primitives/Time.tsx +++ b/src/components/primitives/Time.tsx @@ -10,8 +10,6 @@ export type TimeProps = { export default function Time({ timestamp, prefix }: TimeProps) { const time = useMemo(() => { const targetTime = moment(Number(timestamp)); - const isPast = targetTime.isBefore(moment()); - const then = targetTime .fromNow() .replace(/in\s/, prefix ? `${prefix} ` : "End in ") @@ -22,7 +20,7 @@ export default function Time({ timestamp, prefix }: TimeProps) { .replace(/\bday(s?)\b/g, (_match, plural) => (plural ? "days" : "day")) .replace(/\bmonth(s?)\b/g, (_match, plural) => (plural ? "months" : "month")); - return isPast ? `Ended ${then}` : then; + return then; }, [timestamp, prefix]); return time;