因此,当我添加一个不是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事件的事件显示为时间
答案 0 :(得分: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
},