diff --git a/frontend/src/components/SchedulePage.jsx b/frontend/src/components/SchedulePage.jsx index f05b171..eaea711 100644 --- a/frontend/src/components/SchedulePage.jsx +++ b/frontend/src/components/SchedulePage.jsx @@ -825,7 +825,7 @@ function EventDetailModal({ event, onClose, onEdit, onAvailabilityChange, isTool
- {(isToolManager||(userId&&event.created_by===userId))&&!isPast&&} + {(isToolManager||(!isPast&&userId&&event.created_by===userId))&&}
@@ -1614,7 +1614,14 @@ export default function SchedulePage({ isToolManager, isMobile, onProfile, onHel }; const openDetail = async e => { - try { const { event } = await api.getEvent(e.id); setDetailEvent(event); } catch { toast('Failed to load event','error'); } + try { + const { event } = await api.getEvent(e.id); + // Virtual recurring occurrences carry their own start/end dates — overlay them so + // the modal shows the correct occurrence time and isPast evaluates against the + // occurrence's end_at, not the base event's first-occurrence end_at. + if (e._virtual) { event.start_at = e.start_at; event.end_at = e.end_at; } + setDetailEvent(event); + } catch { toast('Failed to load event','error'); } }; const handleSaved = () => { load(); setPanel('calendar'); setEditingEvent(null); };