From 7eba7dfe226abf4438af7ebc82034094eacefdb2 Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Wed, 9 Sep 2026 22:34:23 +0700 Subject: [PATCH] Calendar: show session time for scheduled local tours The shared EventsCalendar already renders tours alongside events with live countdowns on cards/detail pages. This refines the agenda time display: local tours now carry a specific session time, so the calendar shows that clock time instead of a blanket "All day". Multi-day national/international/destruction tours remain date-only ("All day" / date range), and events are unaffected. - Add allDay flag to CalendarItem (set from tour category) - Local sessions show their start time; other tours stay all-day Co-authored-by: shakespeare.diy --- src/components/EventsCalendar.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/EventsCalendar.tsx b/src/components/EventsCalendar.tsx index e0e09aa..6f78b98 100644 --- a/src/components/EventsCalendar.tsx +++ b/src/components/EventsCalendar.tsx @@ -18,6 +18,8 @@ export interface CalendarItem { to: string; /** RSVP "going" count for events. */ goingCount?: number; + /** True for date-only items with no meaningful clock time (multi-day tours). */ + allDay?: boolean; } interface EventsCalendarProps { @@ -80,9 +82,9 @@ function eventsToItems(events: SkateEvent[], goingCounts?: Map): } function toursToItems(tours: SkateTour[]): CalendarItem[] { - // Only tours with a concrete date range belong on a calendar (mostly - // competition/"destruction" tours). Open-ended local guides have no fixed - // date and are better browsed as a list. + // Only tours with a concrete date belong on a calendar: scheduled local + // sessions plus multi-day national/international/destruction tours. Open-ended + // "book anytime" local guides have no fixed date and are browsed as a list. return tours .filter((t) => typeof t.startDate === 'number') .map((t) => ({ @@ -93,6 +95,8 @@ function toursToItems(tours: SkateTour[]): CalendarItem[] { end: t.endDate, location: t.location ?? t.cities?.[0] ?? t.countries?.[0], to: `/tour/${t.pubkey}/${t.identifier}`, + // Local sessions have a specific clock time; everything else is date-only. + allDay: t.category !== 'local', })); } @@ -335,7 +339,7 @@ export function EventsCalendar({ events, tours, goingCounts, show }: EventsCalen {multiDay ? `${new Date(it.start * 1000).toLocaleDateString([], { month: 'short', day: 'numeric' })} – ${new Date((it.end as number) * 1000).toLocaleDateString([], { month: 'short', day: 'numeric' })}` - : it.kind === 'tour' + : it.allDay ? 'All day' : formatTime(it.start)}