fullcalendar:未捕获TypeError:无法读取未定义的属性'localeData'

时间:2017-11-17 15:06:08

标签: javascript jquery fullcalendar

我正在尝试使用fullcalendar并且它不断抛出此错误。我包含了所有必需的文件:

fullcalendar.js
fullcalendar.css
moment.js

但是我收到以下错误:

Uncaught TypeError: Cannot read property 'localeData' of undefined
    at getMomentLocaleData (fullcalendar.js:2554)
    at locale (fullcalendar.js:2445)
    at Object.defineProperty.value (fullcalendar.js:2559)
    at __webpack_require__ (fullcalendar.js:30)
    at Object.defineProperty.value (fullcalendar.js:12499)
    at __webpack_require__ (fullcalendar.js:30)
    at Object.defineProperty.value (fullcalendar.js:7367)
    at __webpack_require__ (fullcalendar.js:30)
    at Object.defineProperty.value (fullcalendar.js:12109)
    at __webpack_require__ (fullcalendar.js:30)

这是我对fullcalendar的初始化:

window.onload = function () {

    $('#calendar').fullCalendar({
        handleWindowResize: true,
        defaultView: 'month',
        themeSystem: "bootstrap3",
        eventLimit: true,
        //navLinks: true, // enable clicking on different days
        week: true,
        day: true,
        agenda: true,
        basic: true,
        events: [
            {
                title: 'event1',
                start: '2017-11-01'
            },
            {
                title: 'Holiday',
                start: '2017-11-05',
                end: '2017-11-07'
            },
            {
                title: 'event3',
                start: '2017-11-09T12:30:00',
                allDay: false // will make the time show
            }
        ]
    })

    $(".fc-today-button").html('<i class="fa fa-calendar"></i>');
    $(".fc-prev-button").html('<i class="fa fa-arrow-left"></i>');
    $(".fc-next-button").html('<i class="fa fa-arrow-right"></i>');
}

日历显示正常,但由于此错误,任何需要运行的jQuery因为此异常而未运行。

任何指针?

0 个答案:

没有答案