0
我使用FullCalendar 3覆蓋的開始/結束特性,我通過使用startParam
& endParam
像他們改變了事件屬性名稱start_at
& end_at
代替start
& end
在docs說,但它仍然不起作用。這裏是我的JS:FullCalendar無法讀取的未定義的屬性「hasTime」,即使我
<script>
$(document).ready(function() {
$('#calendar').fullCalendar({
locale: 'en',
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultDate: '2017-04-12',
navLinks: true,
editable: true,
eventLimit: true,
events: {
startParam: 'start_at',
endParam: 'end_at',
url: '/products/all',
color: 'yellow'
},
eventRender: function(event, element) {
element.find('.fc-title').html(event.name);
}
});
});
</script>
的url
接受JSON提要這種結構:
[
{
id: 1,
name: "Product 1",
date: "2017-04-11",
start_at: "2017-04-09 18:58:47",
end_at: "2017-04-09 19:58:47",
created_at: "2017-04-09 19:13:47",
updated_at: "2017-04-09 19:13:47",
},
...
]
的問題是,這些事件顯示和使用JSON定義,而不是start_at
或end_at
的date
財產正如我所定義的,如果我刪除它,我得到這個錯誤Uncaught TypeError: Cannot read property 'hasTime' of undefined
,即使我確實這樣定義了events
:
events: {
startParam: 'start_at',
endParam: 'end_at',
//...
}
預先感謝您。
感謝您的回覆,但那不是問題。 – dwix
我很抱歉看到。 – LakiGeri
您是否找到解決方案?我有我的事件在ISO8601字符串日期格式,我有同樣的問題... – Dante