问题描述
我有FullCalendar一个问题,即它不显示我的事件。我有一个想法,事件数据可能是错误的格式,但我看不到应该是什么。
在code以下是我的code的简化版本:
的jQuery('#CAL')。fullCalendar({
默认视图:agendaDay',
axisFormat:'H',//,'H(:毫米)TT',
时间格式: {
议程:'H'// H:{毫米 - H:毫米}
}, firstHour:18,
eventSources:
[{\"id\":64,\"title\":\"TestUser\",\"start\":\"2011-03-08T02:00:00.0000000\",\"end\":\"2011-03-08T04:00:00.0000000\",\"allDay\":false},{\"id\":65,\"title\":\"TestUser\",\"start\":\"2011-03-07T10:00:00.0000000\",\"end\":\"2011-03-07T12:00:00.0000000\",\"allDay\":false}]
,
eventClick:功能(calEvent,jsEvent,视图){
。jQuery的('#divEventTitle')HTML(calEvent.title);
showEvent(calEvent);
jQuery的('#divEvent)对话()。
},
主题:真实,
标题:假的,
身高:450
});
在直接传递事件数据,使用属性是事件,而不是eventSources。
此外,你告诉它向你展示agendaDay,这将只显示小时鉴于目前一天一个小时。由于今天是3月6日,和你的事件是三月份第7和第8日,他们将不会显示在初始页面加载。
I have a problem with FullCalendar where it doesn't display my events. I have an idea that the event data might be in the wrong format, but I can't see what should be.
The code below is a simplified version of my code:
jQuery('#cal').fullCalendar({
defaultView: 'agendaDay',
axisFormat: 'H', //,'h(:mm)tt',
timeFormat: {
agenda: 'H' //h:mm{ - h:mm}'
},
firstHour: 18,
eventSources:
[{"id":64,"title":"TestUser","start":"2011-03-08T02:00:00.0000000","end":"2011-03-08T04:00:00.0000000","allDay":false},{"id":65,"title":"TestUser","start":"2011-03-07T10:00:00.0000000","end":"2011-03-07T12:00:00.0000000","allDay":false}]
,
eventClick: function (calEvent, jsEvent, view) {
jQuery('#divEventTitle').html(calEvent.title);
showEvent(calEvent);
jQuery('#divEvent').dialog();
},
theme: true,
header: false,
height: 450
});
When passing event data directly, the property to use is "events" as opposed to "eventSources".
Also, you're telling it to show you "agendaDay" which will only show the current day in an hour by hour view. As today is March 6th, and your events are for March 7th and 8th, they will not show for the initial page load.
这篇关于Fullcalendar没有显示事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!