【发布时间】:2015-07-11 04:11:47
【问题描述】:
fullcalendar 没有从 google 日历中检索事件,我读到了一些 google calendar api 不再支持 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: 'example@gmail.com'
}
})
});
更新
使用此代码使其工作
eventSources: [
{ googleCalendarApiKey: 'your api key',
googleCalendarId: 'email@gmail.com',
className: 'fc-event-email'}];
【问题讨论】:
-
从 2014 年 11 月 17 日起,谷歌关闭了他们的日历 API 的 V1 和 V2。要使用谷歌日历的完整日历升级到最新版本的 FullCalendar 或至少用这个文件替换 gcal.js @987654321 @ .在上面的代码中,您必须在 eventSources 中包含 googleCalendarApiKey 和 googleCalendarId。检查此链接fullcalendar.io/docs1/google_calendar 以获取文档
-
我通过将 apikey 放入 eventsource ` eventSources: [ { googleCalendarApiKey: 'your api key', googleCalendarId: 'email@gmail.com', className: 'fc-event-email'} ,`
-
酷,请接受我的回答。谢谢!
标签: fullcalendar google-calendar-api