lbertenasco / ap-ng2-fullcalendar

Angular2 fullcalendar component
MIT License
35 stars 18 forks source link

How to get current date when change month or day #33

Closed joaquin595 closed 7 years ago

joaquin595 commented 7 years ago

Hello,

I was wondering if it is possible to get the current date when changing the month or day, since the fullcalendar () function returns void and I can not extract the month from the Moment that it should return.

lbertenasco commented 7 years ago

Hi @joaquin595 you can hook into the viewRender callback on your calendarOptions.

    calendarOptions:Object = {
        ....
        viewRender: (view, element) => this.onViewRender(view, element),
        ....
    }

    onViewRender(view, element) {
        console.log(view.intervalStart);
        console.log(view.intervalEnd);
    }