>参考:fullcalendar 和 gcal v.3.9.0,jquery v.3.3.1,moment v. latest
我正在尝试运行测试日历以显示多个Google日历,但到目前为止尚未显示任何事件。我已经关注了 fullcalendar.io 网站上的文档,但到目前为止还没有成功。以下代码会呈现日历,但不显示 Google 日历事件:
$(document).ready(function() {
function CalendarSource(label, googleCalendarId, name) {
this.label = label;
this.googleCalendarId = googleCalendarId;
this.name = name;
}
// Initialise the main calendar instance
$('#fullcalendar-instance').fullCalendar({
googleCalendarApiKey: 'MyAPIkey',
eventSources: [
{
googleCalendarId: 'gCalID-1',
color: 'green', // an option!
textColor: 'black', // an option!
className: 'my-event-1'
},
{
googleCalendarId: 'gCalID-2',
color: 'blue', // an option!
textColor: 'black', // an option!
className: 'my-event-2'
},
{
googleCalendarId: 'gCalID-3',
color: 'orange', // an option!
textColor: 'black', // an option!
className: 'my-event-3'
}
],
header: {
left: 'prev,next today',
center: 'title',
right: 'prevYear,nextYear',
},
titleFormat: 'MMM YYYY',
dayNamesShort: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
bootstrapFontAwesome: {
close: 'fa-times',
prev: 'fa-angle-left',
next: 'fa-angle-right',
prevYear: 'fa-angle-double-left',
nextYear: 'fa-angle-double-right'
},
timezone: 'Europe/London',
defaultView: 'month',
themeSystem: 'bootstrap4'
})
}(;
如果有人能指出我哪里出错,我将不胜感激。
我根据以下演示从头开始重建页面:http://started%20from%20sratch%20using%20the%20fullcalendar.io/releases/fullcalendar/3.9.0/demos/gcal.html