Fullcalendar - Google日历活动未显示

时间:2018-04-11 17:14:35

标签: fullcalendar

参考:fullcalendar和gcal v.3.9.0,jquery v.3.3.1,时刻v。最新

我正在尝试运行测试日历来显示多个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'
})

});

如果有人能指出我哪里出错了,我将不胜感激。

1 个答案:

答案 0 :(得分:0)