From 9b5f1273b3423b7336a98bb05b7134aea2267c96 Mon Sep 17 00:00:00 2001 From: Padreug Date: Thu, 21 May 2026 16:31:01 +0200 Subject: [PATCH] fix(activities): multi-day time-based events show end date too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ActivityDetailPage.dateDisplay rendered the end of a time-based event as time-only ("19:00 — 21:45"), implying a single calendar day even when the event actually spanned multiple days. The end date was silently lost in the display. Detect whether start and end share the same calendar day; if not, repeat the full date on the end side so a multi-day event reads as "Fri May 29 • 19:00 — Sat May 30 • 21:45". Co-Authored-By: Claude Opus 4.7 (1M context) --- .../activities/views/ActivityDetailPage.vue | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/modules/activities/views/ActivityDetailPage.vue b/src/modules/activities/views/ActivityDetailPage.vue index 6961391..9c509b7 100644 --- a/src/modules/activities/views/ActivityDetailPage.vue +++ b/src/modules/activities/views/ActivityDetailPage.vue @@ -72,11 +72,18 @@ const dateDisplay = computed(() => { } return start } - const start = format(a.startDate, 'EEEE, MMMM d, yyyy \u2022 HH:mm', opts) - if (a.endDate) { - return `${start} — ${format(a.endDate, 'HH:mm', opts)}` - } - return start + // Time-based event. If start and end share the same calendar day, + // show end as time-only ("19:00 — 21:45"). Otherwise repeat the full + // date on the end side so a multi-day event reads unambiguously + // ("May 29 • 19:00 — May 30 • 21:45"). + const FULL = 'EEEE, MMMM d, yyyy \u2022 HH:mm' + const start = format(a.startDate, FULL, opts) + if (!a.endDate) return start + const sameDay = + a.startDate.getFullYear() === a.endDate.getFullYear() && + a.startDate.getMonth() === a.endDate.getMonth() && + a.startDate.getDate() === a.endDate.getDate() + return `${start} — ${format(a.endDate, sameDay ? 'HH:mm' : FULL, opts)}` }) const categoryLabel = computed(() => {