2012-01-11 31 views
0

因此,當我添加一個不是allDay事件的事件時,它似乎仍將其設置爲allDay事件。fullcalendar addDay不工作

JSON代碼

[{"id":"1","agent_id":"1","customer_id":"0","title":"Doctors","text":"This is a test calendar","start":"2012-01-12 10:20:00","end":"2012-01-12 11:00:00","allDay":"false"}] 

我使用下面的加載JSON

eventSources: [ 

           // your event source 
           { 
            url: 'system/fullcalendar-1.5.2/demos/json-events.php', 
            type: 'POST', 

            error: function() { 
             alert('there was an error while fetching events!'); 
            }, 
            //color: 'Light-Blue', // a non-ajax option 
            textColor: 'white' // a non-ajax option 
           }, 

           { 
            url: 'system/classes/core.php?task=calendar&q=fetch&userid='+userid, 
            type: 'POST', 

            error: function() { 
             alert('there was an error while fetching events!'); 
            }, 
            color: 'orange', // a non-ajax option 
            textColor: 'white' // a non-ajax option 
           } 

          // any other sources... 

         ], 

我的問題是如何得到這不應該是一個阿迪事件表明,隨着時間的事件

回答

2

我認爲問題在於你對allDay的布爾值有引號。 docs說:不要在你的真實/錯誤中加入引號。這個值不是一個字符串!

要麼有你的JSON回報:

"allDay": false 

,或者你可以從JSON刪除,並設置allDayDefault屬性源:

eventSources: [ 

    // your event source 
    { 
    url: 'system/fullcalendar-1.5.2/demos/json-events.php', 
    type: 'POST', 
    allDayDefault: false, 
    error: function() { 
         alert('there was an error while fetching events!'); 
         }, 
    //color: 'Light-Blue', // a non-ajax option 
    textColor: 'white' // a non-ajax option 
    },