2015-07-11 56 views
2

fullcalendar没有从谷歌日历中检索事件,我读了一些谷歌日历API不支持fullcalendar了吗?我不知道它的真实性。fullcalendar没有从谷歌日历获取事件

这里是我的代码

$(function() { 
$('#calendar').fullCalendar({ 
header: { 
    left: 'prev,next today', 
    center: 'title', 
    right: 'month,agendaWeek,agendaDay' 
}, 
buttonText: { 
    today: 'today', 
    month: 'month', 
    week: 'week', 
    day: 'day' 
}, 
googleCalendarApiKey: 'myApi', 
eventSources: { 
    googleCalendarId: '[email protected]' 
    } 
}) 
}); 

UPDATE

使其通过使用此代码

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

从2014年11月17日起,Google关闭了其日历API的V1和V2版本。要使用Google日历升级至FullCalendar最新版本的完整日历或至少替换gcal .js与此文件https://github.com/arshaw/fullcalendar/blob/v1.x/gcal.js。在上面的代码中,您必须在eventSources中包含googleCalendarApiKey和googleCalendarId。请查看此链接http://fullcalendar.io/docs1/google_calendar/获取文档 – SGC

+0

我通过将apikey放入eventsource'eventSources中:[ {googleCalendarApiKey:'your api key', googleCalendarId:'[email protected] ', className:'fc-event-email'},' – user3779015

+0

很酷,请接受我的回答。谢谢! – SGC

回答

1

从2014年11月17日的工作,谷歌关闭V1和V2日历的API的。要使用Google日历升级到FullCalendar的最新版本,或者至少用此文件替换gcal.js,请使用完整日历github.com /arshaw/fullcalendar/blob/v1.x/gcal.js。在上面的代码中,您必须在eventSources中包含googleCalendarApiKey和googleCalendarId。请检查此链接fullcalendar.io/docs1/google_calendar以获取文档