4

我正在使用 FullCalendar 并通过 ajax 调用填充日历。

但是如果 allday 设置为 false,我无法显示时间

我正在查看FullCalendar 没有显示来自 JSON 事件的时间,但似乎没有帮助。

这是我发回的 JSON:

][{"id":"18","title":"r2222","start":"2012-10-02 08:00:00","end":"2012-10-02 11:00: 00","textColor":"#000000","allday":false,"color":"#ffffff"},

{"id":"1","title":"Test 123","start":"2012-10-16","end":null,"textColor":"#000000","allday":false "颜色":"#ffffff"},

{"id":"16","title":"happy gallown","start":"2012-10-31","end":"2012-10-31","textColor":"#fffcfc" ,"allday":true,"color":"#d92727"},

{"id":"17","title":"recur","start":"2012-10-03 19:00:00","end":"2012-10-03 21:00:00" ,"textColor":"#000000","allday":false,"color":"#ff56ff"}]

4

2 回答 2

6

allDay区分大小写;把它改成allday——allDay我自己只花了 25 分钟来寻找这个。

于 2012-10-23T03:06:04.150 回答
-1

你可以按照这个alldayallDay和 Time should be start:2010-01-09T12:30:00需要T在 date 和 time 之间添加。

events: [
    {
        title  : 'event1',
        start  : '2010-01-01'
    },
    {
        title  : 'event2',
        start  : '2010-01-05',
        end    : '2010-01-07'
    },
    {
        title  : 'event3',
        start  : '2010-01-09T12:30:00',
        allDay : false // will make the time show
    }
]
于 2017-09-19T09:28:47.313 回答