A.Rsmor
A.Rsmor

Reputation: 21

Fullcalendar and jQuery datepicker

I'm using fullcalendar v2.7.1 and jQuery datepicker. After selecting a month/year from the datepicker, how do you advance the fullcalendar to the values selected from the datepicker?

The older version of fullcalendar v1.5.4 use to work using the code below.

jQuery

('#datepicker').datepicker({  
  onChangeMonthYear: function(month, year, inst) {
    $('#calendar').fullCalendar('gotoDate',month, year, inst);
  },  
});

Upvotes: 2

Views: 2101

Answers (1)

pumpkinzzz
pumpkinzzz

Reputation: 2967

according to the Documentation gotoDate accepts a Moment object.

So, try with this:

$('#calendar').fullCalendar();
$('#datepicker').datepicker({  
  onChangeMonthYear: function(y, m, inst) {
        var day = moment({ year :y, month :m });
        $('#calendar').fullCalendar('gotoDate',day);
  },  
});

See this working example: FIDDLE

Upvotes: 2

Related Questions