Missing Events at the end of the week (after 7:00 PM) with gcalFeed
I have an implementation of FullCalendar pulling a Google Calendar feed for a Community Ice Rink.
Everything seems to be working fine except the last two events of开发者_StackOverflow社区 the week are missing from 7:00PM on on Saturday. I have tried deleting the events, adding a different event. Renaming events, removing other events to see if there are too many.
The XML feed is valid. I don't know what else to do. There isn't a javascript error.
This is the URL for the Calendar (http://www.google.com/calendar/feeds/0vf900bq0u01v826rjvirb02b4%40group.calendar.google.com/public/basic) and this is the code that I am using:
$(function() {
$('#fullcal').fullCalendar({
events:
$.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/0vf900bq0u01v826rjvirb02b4%40group.calendar.google.com/public/basic',
{
// put your options here
className: 'gcal-event',
currentTimezone: 'America/Denver'
}
),
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultView: 'agendaWeek',
eventClick: function(event) {
window.open(event.url, 'gcalevent', 'width=700,height=600');
return false;
},
loading: function(bool) {
if (bool) {
$('#loading').show();
} else {
$('#loading').hide();
}
}
});
});
I know this was asked several years ago, but I just ran into this and I have an ugly workaround that may help others with this issue.
Here's how I got things looking right with agendaViews:
In the initialization of the Fullcalendar, set the defaultView to 'month'. Next, set lazyFetching to true. Now, set the 'loading' method to change the view type. The initialization should look something like this:
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: ''
},
defaultView: 'month',
allDayDefault: false,
timeFormat: '',
allDaySlot: false,
editable: false,
lazyFetching: true,
eventLimit: false,
events: 'https://www.google.com/calendar/feeds/mycalendarURL',
loading: function(bool) {
$('#calendar').fullCalendar( 'changeView', 'agendaWeek' );
}
});
Believe it or not, the original 'month' view does not show up; the agendaWeek view is the only one that appears - at least as I'm testing it here at the moment in Safari on my Mac.
Basically this hack method sets the view to a view that seems to gather all the events correctly, then, the view is switched to what we really want to see. By turning lazyFetching on, the events that are already loaded in stay loaded in.
Note that if the user navigates to far future or past events, more events will need to be loaded. When this happens, everything goes amuck once again, even if the user navigates back to where he started. For my application, I am limiting viewing to a small date range, so this is fine. For other applications, this could be a problem.
Hopefully a proper solution will someday appear because I found at least three other people who have seen this problem after I scoured the internet trying to find a solution. Hopefully my hack solution will help others until this is formally fixed.
精彩评论