monthChange callback has old month state

Issue #42 new
chrisashley NA created an issue

Hi,

I've hooked up to the monthChange event like so:

 $("#responsive-calendar").responsiveCalendar({
            time: formatDate(new Date()),
            onMonthChange: monthChange
        });

However it looks like the old month state is returned (EG, calendar is on June, I click next, in my event it returns 6 as the currentMonth), so at the moment I have to use this workaround. Is this a bug or intentional behaviour? Thanks in advance.

    function monthChange()
    {
        debugger;
        var dateString = "";

        // state doesnt seem to be updated until after its called back, so manually increment by 1...
        var month = (this.currentMonth % 12) + 1;

Comments (1)

  1. Log in to comment