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)}