Files
EpicNext-Cms/src/lib/services/dashboard-event-phase.ts
T
Simo c389c3893d
CI / check (push) Successful in 52s
CI / deploy (push) Successful in 2m10s
CI / publish-container (push) Failing after 1m18s
feat(cms): improve catalog, editorial recovery and operations
2026-09-09 19:36:15 +02:00

9 lines
311 B
TypeScript

export function getDashboardEventPhase(
event: { status: string; startsAt: Date; endsAt: Date | null },
now: Date,
): "upcoming" | "ongoing" | null {
if (event.status !== "published") return null;
if (event.startsAt > now) return "upcoming";
return event.endsAt && event.endsAt > now ? "ongoing" : null;
}