From 239b73d4dd53a2eec7f034881101560589e68140 Mon Sep 17 00:00:00 2001 From: Micha de Vries Date: Fri, 12 Apr 2024 08:32:57 +0200 Subject: [PATCH] datetooltip forcetime --- src/app/[locale]/(public)/e/[event]/page.tsx | 4 ++-- src/components/miscellaneous/DateTooltip.tsx | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app/[locale]/(public)/e/[event]/page.tsx b/src/app/[locale]/(public)/e/[event]/page.tsx index 9c384d1..a225718 100644 --- a/src/app/[locale]/(public)/e/[event]/page.tsx +++ b/src/app/[locale]/(public)/e/[event]/page.tsx @@ -186,7 +186,7 @@ export default function Page() { Start of event

- +

)} @@ -196,7 +196,7 @@ export default function Page() { End of event

- +

)} diff --git a/src/components/miscellaneous/DateTooltip.tsx b/src/components/miscellaneous/DateTooltip.tsx index 594fd8e..94d3db1 100644 --- a/src/components/miscellaneous/DateTooltip.tsx +++ b/src/components/miscellaneous/DateTooltip.tsx @@ -14,14 +14,20 @@ dayjs.extend(duration); dayjs.extend(localizedFormat); dayjs.extend(relativeTime); -export function DateTooltip({ date }: { date: Date }) { +export function DateTooltip({ + date, + forceTime, +}: { + date: Date; + forceTime?: boolean; +}) { return ( {date.getTime() > new Date().getTime() - ? dayjs(date).format('ll') + ? dayjs(date).format(forceTime ? 'lll' : 'll') : dayjs.duration(dayjs(date).diff()).humanize(true)}