0
votes

For some reason I'm having a hard time getting fullcalendar to work using the google api. The calendar displays but no events are showing. Google developer console is not showing any requests. I've generated my api key and my calendar is public (I've double check a thousand times!) Could someone please check this code and tell me what I'm doing wrong! Using Fullcalendar v2.3.2

<link rel="stylesheet" href="css/style.css">
<link rel='stylesheet' href='css/fullcalendar.css' />
<script src='js/jquery.min.js'></script>
<script src='js/moment.min.js'></script>
<script src='js/fullcalendar.js'></script> 
<script type='text/javascript' src='js/gcal.js'></script>    
<script src="js/calendar-events.js"></script>

<script type='text/javascript'>

$(document).ready(function() {
$('#calendar').fullCalendar({
    googleCalendarApiKey: 'AIzaSyAl9hbpRJO_xVWj2RIZ1l0BwrvgwgMaWZg',
    events: {
        googleCalendarId: '[email protected]'
    }


});
});
</script>
2

2 Answers

0
votes

Check and see if the Calendar API is listed as one of the 'Enabled APIs' in your project in the drop-down at the top of the APIs screen. If not - click the Calendar API and click Enable.

0
votes

I know this issue is a bit stale, but it still took me forever to find a solution that worked. The api key and calendar id should be within eventSources. Also make sure that you have the latest version of fullcalendar (or atleast the latest gcal.js).

Below is the code the I found worked. I found the solution here.

eventSources: [
  { googleCalendarApiKey: 'your api key',
  googleCalendarId: '[email protected]',
  className: 'fc-event-email'}]