0
我使用Fullcalendar从http://arshaw.com/fullcalendar/,我有搜索stackoverflow,但没有answear适合我的问题,或者我没有理解。如果这已经是answear,请粘贴链接。Fullcalendar议程视图和日事件不会在特定时间内呈现事件(小时)
我有一个返回事件的XML文件:
事件例如:
<event allDay="false" editable="true" end="Mon Apr 29 2013 15:30:00 GMT+0100" id="53" start="Mon Apr 29 2013 08:30:00 GMT+0100" title="tesete"/>
如果你注意到的开始和结束日
,时间格式保存这个样子。
当我取的事件,像这样:
events: function(start, end, callback) {
$.ajax({
type: 'POST',
url: url,
dataType:'xml',
crossDomain: true,
data: {
// our hypothetical feed requires UNIX timestamps
start: Math.round(start.getTime()/1000),
end: Math.round(end.getTime()/1000),
'ajax':true,
'acc':'2',
},
success: function(doc) {
var events = [];
$(doc).find('event').each(function()
{
events.push({
id: $(this).attr('id'),
title: $(this).attr('title'),
start: $(this).attr('start'),
end: $(this).attr('end'),
allDay: $(this).attr('allDay'),
editable: $(this).attr('editable')
});
});
callback(events);
}
});
},
所有事件在月视图中显示正常,但是当我切换到agendaView或dayView,该事件仅在阿迪酒吧,他们不在特定小时之间呈现。
start="Mon Apr 29 2013 08:30:00 GMT+0100" end="Mon Apr 29 2013 15:30:00 GMT+0100" id="53"
从8:30到15:30例如
我在想什么?
解决方案的问题:
events: function(start, end, callback) {
$.ajax({
type: 'POST',
url: 'myurl',
dataType:'xml',
crossDomain: true,
data: {
// our hypothetical feed requires UNIX timestamps
start: Math.round(start.getTime()/1000),
end: Math.round(end.getTime()/1000),
'ajax':true,
'acc':'2',
},
success: function(doc) {
var events = [];
var allday = null; //Workaround
$(doc).find('event').each(function()
{
if($(this).attr('allDay') == "false") //Workaround
allday = false; //Workaround
if($(this).attr('allDay') == "true") //Workaround
allday = true; //Workaround
events.push({
id: $(this).attr('id'),
title: $(this).attr('title'),
start: $(this).attr('start'),
end: $(this).attr('end'),
allDay: allday,
editable: $(this).attr('editable')
});
});
callback(events);
}
});
},
是的,但这是一个xml文件中的事件,因此属性值必须在引号中才能成为一个值。 – 2013-04-29 13:03:50
我想问题在于保存的日期格式。 – 2013-04-29 13:04:27
你对我的朋友很感谢,谢谢:),对不起,因为你是dumm :) 这里实际上也是awnseared: http://stackoverflow.com/questions/9933373/formatting-events-date-and-time- on-fullcalender – 2013-04-29 13:32:40