Open
Description
Describe the bug
hello @mattlewis92, I'm experiencing some issues with your package.
as you can see in the below screenshot beforeViewRender event calls infinite times when I try to feed events to the calendar lazily here is my code
<mwl-calendar-month-view
*ngSwitchCase="'month'"
[viewDate]="viewDate"
[events]="events"
[activeDayIsOpen]="true"
[refresh]="refresh"
(eventTimesChanged)="eventTimesChanged($event)"
(beforeViewRender)="onViewRender($event)"
>
and the logic
onViewRender(viewRenderEvent: any): void
{
const start = new Date(viewRenderEvent.period.start).toISOString();
const end = new Date(viewRenderEvent.period.end).toISOString();
console.log(start, end);
setTimeout(() => {
this.events = e.filter(ev => ev.start.toISOString() >= start && ev.end?.toISOString()! <= end);
});
}
just so you know this is just a demo in a real application I'm gonna fetch the events from the server via period.start and period.end.
@angular/core
: ^16.1.0angular-calendar
: ^0.31.0- Browser name and version: Chorome@latest
Metadata
Metadata
Assignees
Labels
No labels