我使用 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
为 null,同样设置为 rangeStart
,这是在 fetchEventSource 中调用克隆的属性
。我正在使用 defaultview
月份。我已经没有想法了。请帮帮我。
P.S 我正在 Angular 2 中尝试这个。我正在使用 fullCalendar version 2.7.3
。 jquery
版本为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;
}
}
.....
最佳答案
我在尝试包含 angular-ui / fullcalender 时遇到了这个问题.该模块的最后一个版本 (1.0.2) 依赖于 jQuery 2.x,并且不与 jQuery 3.x 一起工作。根据 this,与 jQuery 3 一起使用的第一个 fullcalender 版本是 v2.8.0。 .
我决定回退到 jQuery 2.1.4 但如果你需要它,你可以使用 当前主分支。它在 2.9.x 版本中使用 fullcalender。
希望这对您有所帮助!
关于angular - currentView.start 为空 fullcalendar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37851716/