Reputation: 439
Hi I'm using fullCalendar jQuery plugin. This code is written based on https://www.drupal.org/node/1345028#comment-5258592
I got issue:
Uncaught TypeError: Cannot read property 'fullCalendar' of undefined
What's wrong? Why this chaining doesn't work?
I wanted to make when user clicks on a day (dayClick), go to arbitrary date (gotoDate) and changes view (changeView)
$(document).ready(function(){
$('#calendar').fullCalendar({
header:
{
center: 'month,basicDay'
},
defaultView: 'month',
dayClick: function(date, allDay, jsEvent, view){
// here what's wrong ↓
$('#calendar').fullCalendar('gotoDate', date).fullCalendar('changeView', 'basicDay');
}
});
});
Upvotes: 0
Views: 6825
Reputation: 3546
I belive your second call to fullCalendar in line below causes this
$('#calendar').fullCalendar('gotoDate', date).fullCalendar('changeView', 'basicDay');
Maybe try this or something similar:
$('#calendar').fullCalendar('gotoDate', date);
$('#calendar').fullCalendar('changeView', 'basicDay');
Upvotes: 1