FullCalendar not displaying event times

I've seen this asked (and answered) a number of times, but thus far none of the solutions is working for me.

I have a cfc that returns json data to an instance of FullCalendar.

The returned data looks like this:

[{"id":2,"title":"Test Event One","start":"February, 17 2011 09:30:00","end":"February, 17 2010 10:30:00","allday":false}]

The event is showing on the right day in all the calendar views - but is showing up in the all day section.

I'm invoking the calendar like this:

$('#calendar').fullCalendar({
    editable: true,
    events:'getEvents.cfc?method=getEvents&returnformat=json',
    header: {
        right: '',
        center: 'prev,next today',
        left: 'agendaDay,agendaWeek,month,'
        }

I'd really appreciate any help with this - Thanks


It doesn't appear that you're returning the date in the format the fullCalendar object expects. Looking at the Event Object documentation, you need to return the dates in the following formats:

start: Date A JavaScript Date object indicating the date/time an event begins.

When specifying Event Objects for events or eventSources, you may specify a string in IETF format (ex: "Wed, 18 Oct 2009 13:00:00 EST"), a string in ISO8601 format (ex: "2009-11-05T13:15:30Z") or a UNIX timestamp.


这就是我在jason-event.php工作

<?php

$year = date('Y');
$month = date('m');

echo json_encode(array(
    //May
    array(
        'id' => 1,
        'title' => 'Cardio-Kick Boxing and Adult Kung Fu ONLY',
        'start' => '2011-05-28 9:30:00',
        'end' => '2011-05-28 12:00:00',
        'allDay' => false,
        'url' => 'http://maxfit.us/'
    ),
));

?>
链接地址: http://www.djcxy.com/p/39412.html

上一篇: 显示事件标题

下一篇: FullCalendar不显示事件时间