2011-03-06 165 views
1

我遇到FullCalendar問題,它不顯示我的事件。我有一個想法,事件數據可能是錯誤的格式,但我不明白應該是什麼。Fullcalendar不顯示事件

下面的代碼是我的代碼的簡化版本:

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 
      }); 

回答

2

當直接傳遞事件數據,使用屬性是「事件」,而不是「eventSources」。

另外,您告訴它會向您顯示「agendaDay」,它只顯示當前每天一小時的視圖。今天是3月6日,而你的活動是在3月7日和8日,他們不會顯示最初的頁面加載。