因此,当我添加一个不是allDay事件的事件时,它似乎仍然将其设置为allDay活动。
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...
],
我的问题是如何将不应该是全天事件的事件显示为时间
我认为问题是在allDay的布尔值周围有引号。医生说:不要在你的真/假两边加引号。此值不是字符串!
要么返回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
},