Fullcalendar is not displaying events
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.
精彩评论