I'm following the tutorial for Angular 14+ calendar here: https://mattlewis92.github.io/angular-calendar/#/group-similar-events
But it's giving me an exception when trying to assign the array.
Element implicitly has an 'any' type because expression of type '"eventGroups"' can't be used to index type 'MonthViewDay<EventGroupMeta>'.
Property 'eventGroups' does not exist on type 'MonthViewDay<EventGroupMeta>'.ts(7053)
What am I missing here?
beforeMonthViewRender({
body,
}: {
body: CalendarMonthViewDay<EventGroupMeta>[];
}): void {
// month view has a different UX from the week and day view so we only really need to group by the type
body.forEach((cell) => {
var groups: any;
cell.events.forEach((event: CalendarEvent<EventGroupMeta>) => {
groups[event.meta!.type] = groups[event.meta!.type] || [];
groups[event.meta!.type].push(event);
});
cell['eventGroups'] = Object.entries(groups);
});
}