Reputation: 21
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
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