Agenda refactor
This commit is contained in:
parent
df21ed0c4a
commit
c6ce56f469
@ -1464,15 +1464,25 @@ export function CalendarClient({ initialCalendars, userId, userProfile }: Calend
|
|||||||
center: "title",
|
center: "title",
|
||||||
right: "",
|
right: "",
|
||||||
}}
|
}}
|
||||||
events={calendars
|
events={(() => {
|
||||||
.filter(cal => visibleCalendarIds.includes(cal.id))
|
const visibleCalendars = calendars.filter(cal => visibleCalendarIds.includes(cal.id));
|
||||||
.flatMap(cal =>
|
const allEvents = visibleCalendars.flatMap(cal => {
|
||||||
(cal.events || []).map(event => ({
|
const events = cal.events || [];
|
||||||
id: event.id,
|
console.log(`[CALENDAR] Calendar ${cal.name} (${cal.id}): ${events.length} events, visible: ${visibleCalendarIds.includes(cal.id)}`);
|
||||||
title: event.title,
|
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),
|
start: new Date(event.start),
|
||||||
end: new Date(event.end),
|
end: new Date(event.end),
|
||||||
allDay: event.isAllDay,
|
allDay: event.isAllDay,
|
||||||
description: cleanDescription(event.description),
|
description: cleanDescription(event.description),
|
||||||
location: event.location,
|
location: event.location,
|
||||||
calendarId: event.calendarId,
|
calendarId: event.calendarId,
|
||||||
@ -1487,8 +1497,11 @@ export function CalendarClient({ initialCalendars, userId, userProfile }: Calend
|
|||||||
originalEvent: event,
|
originalEvent: event,
|
||||||
color: cal.color
|
color: cal.color
|
||||||
}
|
}
|
||||||
}))
|
}));
|
||||||
)}
|
});
|
||||||
|
console.log(`[CALENDAR] Total events for FullCalendar: ${allEvents.length}`);
|
||||||
|
return allEvents;
|
||||||
|
})()}
|
||||||
eventContent={(arg) => {
|
eventContent={(arg) => {
|
||||||
return (
|
return (
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user