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:
parent
79be46c33d
commit
9b5f1273b3
1 changed files with 12 additions and 5 deletions
|
|
@ -72,11 +72,18 @@ const dateDisplay = computed(() => {
|
||||||
}
|
}
|
||||||
return start
|
return start
|
||||||
}
|
}
|
||||||
const start = format(a.startDate, 'EEEE, MMMM d, yyyy \u2022 HH:mm', opts)
|
// Time-based event. If start and end share the same calendar day,
|
||||||
if (a.endDate) {
|
// show end as time-only ("19:00 — 21:45"). Otherwise repeat the full
|
||||||
return `${start} — ${format(a.endDate, 'HH:mm', opts)}`
|
// date on the end side so a multi-day event reads unambiguously
|
||||||
}
|
// ("May 29 • 19:00 — May 30 • 21:45").
|
||||||
return start
|
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(() => {
|
const categoryLabel = computed(() => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue