fix(activities): multi-day time-based events show end date too

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) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-05-21 16:31:01 +02:00
commit 9b5f1273b3

View file

@ -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(() => {