I’m trying to display a jQuery FullCalendar (http://arshaw.com/fullcalendar) inside a Grails GSP and to populate it from a controller. Here is the Javascript code to initialize my calendar:
$('#container').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: false,
firstDay: 1,
events: '${createLink(controller: "myEvent", action: "events")}'
});
And my controller returns the following JSON (curtesy of Firebug):
[{"id":"1","title":"Devoxx 2010","allDay":true,"start":new Date(1289775600000),"end":new Date(1290121200000),"url":"http://www.devoxx.com"}]
And the problem is that I don’t see anything appear in the calendar although I’m on the right month. No event is displayed and I don’t get any errors. Any idea what may be missing?
If firebug is returning that exact string as you have it, it’s not going to work because of the new Date() functions. The dates should already be a date. Not a function to create a date. For example, my json looks like the following: