angular-calendar - how to programmatically navigate

494 Views Asked by At

I am using https://github.com/mattlewis92/angular-calendar and I would like to navigate programmatically (Next, Previous, Today).

I know the directives (e.g. mwlCalendarPreviousView, mwlCalendarNextView) but I would like to navigate via an API call.

How can I achieve this?

TIA

1

There are 1 best solutions below

0
On

Changing viewDate "date", example with Moment and MonthView:

// Next
this.viewDate = moment(this.viewDate ).add(1, 'months').toDate();
// Previous
this.viewDate = moment(this.viewDate ).add(-1, 'months').toDate();