Agenda refactor

This commit is contained in:
alma 2026-01-14 21:34:20 +01:00
parent df21ed0c4a
commit c6ce56f469

View File

@ -1464,15 +1464,25 @@ export function CalendarClient({ initialCalendars, userId, userProfile }: Calend
center: "title",
right: "",
}}
events={calendars
.filter(cal => visibleCalendarIds.includes(cal.id))
.flatMap(cal =>
(cal.events || []).map(event => ({
id: event.id,
title: event.title,
events={(() => {
const visibleCalendars = calendars.filter(cal => visibleCalendarIds.includes(cal.id));
const allEvents = visibleCalendars.flatMap(cal => {
const events = cal.events || [];
console.log(`[CALENDAR] Calendar ${cal.name} (${cal.id}): ${events.length} events, visible: ${visibleCalendarIds.includes(cal.id)}`);
if (events.length > 0) {
console.log(`[CALENDAR] Events for ${cal.name}:`, events.slice(0, 3).map(e => ({
id: e.id,
title: e.title,
start: e.start,
isAllDay: e.isAllDay
})));
}
return events.map(event => ({
id: event.id,
title: event.title,
start: new Date(event.start),
end: new Date(event.end),
allDay: event.isAllDay,
allDay: event.isAllDay,
description: cleanDescription(event.description),
location: event.location,
calendarId: event.calendarId,
@ -1487,8 +1497,11 @@ export function CalendarClient({ initialCalendars, userId, userProfile }: Calend
originalEvent: event,
color: cal.color
}
}))
)}
}));
});
console.log(`[CALENDAR] Total events for FullCalendar: ${allEvents.length}`);
return allEvents;
})()}
eventContent={(arg) => {
return (
<TooltipProvider>