fix: MC series uses earliest slot date for registration cutoff
Multi-session master classes are a series — once the first session passes, the group has started and registration closes. Changed all MC date logic from "latest slot" / "any future slot" to "earliest slot": - DashboardSummary: upcoming = earliest slot >= today - McRegistrationsTab: archive = earliest slot < today - AddBookingModal: only show MCs where earliest slot >= today - Public MasterClasses: isUpcoming checks earliest slot
This commit is contained in:
@@ -582,7 +582,8 @@ function DashboardSummary({ onNavigate }: { onNavigate: (tab: Tab) => void }) {
|
||||
// Build set of upcoming MC titles
|
||||
const upcomingTitles = new Set<string>();
|
||||
for (const mc of mcData.items || []) {
|
||||
if (mc.slots?.some((s) => s.date >= today)) upcomingTitles.add(mc.title);
|
||||
const earliest = mc.slots?.reduce((min, s) => s.date < min ? s.date : min, mc.slots[0]?.date ?? "");
|
||||
if (earliest && earliest >= today) upcomingTitles.add(mc.title);
|
||||
}
|
||||
return regs.filter((r) => upcomingTitles.has(r.masterClassTitle));
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user