I'm using Fullcalendar from http://arshaw.com/fullcalendar/ , i have search stackoverflow but no answear fits my problem, or i didnt understood. Please paste links if this was already answear.
I have a xml file that returns events:
Event example:
<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"/>
if you notice the start and end day, the time format was saved like this.
When i fetch the events like so:
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);
}
});
},
All events show up in the month view correctly, but when i switch to agendaView or dayView, the events are only in the allDay bar, they are not rendered between the specific hour.
start="Mon Apr 29 2013 08:30:00 GMT+0100" end="Mon Apr 29 2013 15:30:00 GMT+0100" id="53"
From 8:30 to 15:30 for example
What am i missing?
SOLUTION TO THE PROBLEM:
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);
}
});
},
Var allDay must not be a string. It should be allDay=false
without the quotes