Choose which week or jump to first event

Hi, I’m using
view: MbscEventcalendarView = {
schedule: {
type: ‘week’,
allDay: false,
startDay: 1,
endDay: 6,
startTime: ‘07:00’,
endTime: ‘19:00’
}
};

and want to show events which are not in the present week. Is it possible to choose which week to show or even better jump to the right week with the first event?

Hello @Bastifix :wave:

Sure, you can use the navigate method for that. With this method, you can navigate to the specified date and time on the scheduler.

Ok, thanks! But it’s not yet navigating:

ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'navigate')
TypeError: Cannot read properties of undefined (reading 'navigate')

I tried in HTML:
<mbsc-eventcalendar #myEventcalendar ...

and in ts-file:
@ViewChild('myEventcalendar', { static: false })
instance: MbscEventcalendar;

in the function after loading the events:
this.instance.navigate(this.myEvents[0].start)

The calendar is not visible on init, can this be the reason?

Got it: I had it in a *ngIf now I packed it in a [hidden] and it’s working :wink:

Thanks to @Kebs:
With [selectedDate]="selectedDate" and this.selectedDate = this.myEvents[0].start it’s even working inside a *ngIf and without the this.instance.navigate(this.myEvents[0].start)

https://forum2.mobiscroll.com/t/refresh-mbsceventcalendarview-after-changing-startdate-and-enddate/1329/2