title: Uncaught TypeError: Cannot read property 'fullCalendar' of undefined
body: <p>Hi I'm using fullCalendar jQuery plugin. This code is written based on <a href="https://www.drupal.org/node/1345028#comment-5258592" rel="nofollow">https://www.drupal.org/node/1345028#comment-5258592</a> </p>
  
  <p>I got issue: </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'fullCalendar' of undefined</p>
  </blockquote>
  
  <p>What's wrong? Why this chaining doesn't work?</p>
  
  <p>I wanted to make when user clicks on a day (dayClick), go to arbitrary date (gotoDate) and changes view (changeView)</p>
  
  <pre><code>$(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');
  
  
  
        }
      });
  });
  </code></pre>