currentView.start为null fullcalendar

时间:2016-06-16 06:45:17

标签: angular fullcalendar

我使用Primeng的日程安排组件来显示具有日程安排功能的日历。但我一直得到以下错误:

ORIGINAL EXCEPTION: TypeError: Cannot read property 'clone' of null
ORIGINAL STACKTRACE:
TypeError: Cannot read property 'clone' of null
    at _fetchEventSource (http://localhost:8100/build/js/fullcalendar.js:10703:16)
    at fetchEventSource (http://localhost:8100/build/js/fullcalendar.js:10635:3)
    at fetchEvents (http://localhost:8100/build/js/fullcalendar.js:10629:4)
    at fetchAndRenderEvents (http://localhost:8100/build/js/fullcalendar.js:9789:3)
    at getAndRenderEvents (http://localhost:8100/build/js/fullcalendar.js:9780:4)
    at renderView (http://localhost:8100/build/js/fullcalendar.js:9671:6)
    at initialRender (http://localhost:8100/build/js/fullcalendar.js:9588:3)
    at Calendar_constructor.render (http://localhost:8100/build/js/fullcalendar.js:9552:4)
    at HTMLDivElement.<anonymous> (http://localhost:8100/build/js/fullcalendar.js:53:13)
    at Function.each (http://localhost:8100/build/js/jquery.min.js:2:2813)

在进一步调试时,我发现currentView.start为空,同样设置为rangeStart,这是在fetchEventSource中调用克隆的属性。我正在使用defaultview个月。我已经没想完了。请帮帮我。 P.S我在角度2中尝试这个。我正在使用fullCalendar version 2.7.3jquery的版本为3.0.0,moment.js的版本为2.13.1。

以下代码会导致错误。它是fullCalendar.js

的一部分
function _fetchEventSource(source, callback) {
        var i;
        var fetchers = FC.sourceFetchers;
        var res;

        for (i=0; i<fetchers.length; i++) {
            res = fetchers[i].call(
                t, // this, the Calendar object
                source,
                rangeStart.clone(),
                rangeEnd.clone(),
                options.timezone,
                callback
            );

            if (res === true) {
                // the fetcher is in charge. made its own async request
                return;
            }
            else if (typeof res == 'object') {
                // the fetcher returned a new source. process it
                _fetchEventSource(res, callback);
                return;
            }
        }
.....

2 个答案:

答案 0 :(得分:0)

如果开始日期和结束日期相同,则FullCalendar只将结束日期设为空值。克隆结束日期时,检查value是否为null,如果是,请改为使用开始日期。

检查以下链接。是的,这是一个古老的知识问题。

https://code.google.com/p/fullcalendar/issues/detail?id=1014

答案 1 :(得分:0)

我尝试包含angular-ui / fullcalender时遇到了这个问题。该模块的最后一个版本(1.0.2)依赖于jQuery 2.x并且与jQuery 3.x一起使用。根据{{​​3}},与jQuery 3一起使用的第一个版本的fullcalender是v2.8.0。

我决定回到jQuery 2.1.4但如果你需要它,你可以使用 现任主分公司。它在版本2.9.x中使用fullcalender。

希望这有帮助!