每天只有Json Request显示的单个事件

时间:2011-12-18 10:27:30

标签: fullcalendar

我遇到的问题是每天只有1个事件在显示。

我的初始代码是:

$('#calendar').fullCalendar({
    header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        editable: false,
        events: "/cal/get",
        loading: function(bool) {
            if (bool) $('#loading').show();
            else $('#loading').hide();
        }

    });

我的json代码是:

[{"id":"11","title":"2053","start":"2011-12-23T11:00:00","end":"2011-12-23T12:05:00","allDay":false},{"id":"13","title":"2057","start":"2011-12-17T23:00:00","end":"2011-12-18T0:05:00","allDay":false},{"id":"9","title":"2060","start":"2011-12-17T20:45:00","end":"2011-12-17T21:45:00","allDay":false},{"id":"15","title":"2059","start":"2011-12-17T2:00:00","end":"2011-12-17T3:30:00","allDay":false},{"id":"14","title":"2058","start":"2011-12-17T1:30:00","end":"2011-12-17T3:30:00","allDay":false},{"id":"12","title":"2052","start":"2011-12-16T15:15:00","end":"2011-12-16T16:15:00","allDay":false},{"id":"8","title":"2056","start":"2011-12-07T9:45:00","end":"2011-12-07T10:30:00","allDay":false}]

但我所得到的只是每一天的单一事件。我已经阅读了文档和答案,但仍然无法得出结论。任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:0)

您的活动的时间戳不正确。

以12月17日为例。

{"id":"9","title":"2060","start":"2011-12-17T20:45:00","end":"2011-12-17T21:45:00","allDay":false},
{"id":"15","title":"2059","start":"2011-12-17T2:00:00","end":"2011-12-17T3:30:00","allDay":false},
{"id":"14","title":"2058","start":"2011-12-17T1:30:00","end":"2011-12-17T3:30:00","allDay":false},

2:00:00不是有效的时间戳,如果你的意思是凌晨2点,它需要有一个前导0,如果你的意思是下午2,它需要是14:00:00

结束时间相同,3:30:00需要03:30:00或15:30:00。