views:

33

answers:

1

I'm having a strange problem with the Google Calendar API (through PHP with Zend_Gdata.) On the calendar in question I have several recurring events starting in March:

  • 2010-04-19 9:30 - 16:00
  • 2010-04-20 10:00 - 15:30
  • 2010-04-21 9:30 - 16:00
  • 2010-04-22 10:00 - 15:30
  • 2010-04-23 9:30 - 12:30

Each of these repeats indefinitely but has exceptions on some days. My problem is that none of the canceled or modified instances are returned by the API after 2010-07-15. During the week of August 2nd, all 5 of these recurrences are canceled, and they display as such in Google Calendar, but the API does not return exceptions for these days.

I am querying the calendar with the following code:

$gc = new Zend_Gdata_Calendar($client);

$query = $gc->newEventQuery();
$query->setUser(/*calendar ID goes here*/);
$query->setVisibility('private');
$query->setProjection('full');
$query->setOrderby('starttime');
$query->setSortorder('ascending');
$query->setMaxResults(500);

$query->setSingleEvents("false");

$query->setStartMin('2010-06-01 00:00:00');
$query->setStartMax('2010-09-20 00:00:00');
$query->setQuery(/*title of the events*/);

return $gc->getCalendarEventFeed($query);

The resulting feed contains all 5 recurrences, and "canceled" event objects for all deleted instances up to 2010-07-15 where they arbitrarily stop. I should note that the getWhen() array on each recurrence contains the correct times (i.e. it omits the canceled dates) but due to the way my program is coded, it's important that I have access to the actual canceled event objects.

What could possibly be causing the API to not return all the canceled/modified events? Max results can't be the problem since there are only about 30 events in the feed. I'm basically out of ideas.

Thanks in advance.

A: 

I'm convinced this is a bug in the calendar API and I ended up writing a workaround for it.

I wrote code to calculate the expected instances of an event based on the start and recurrence data and then compare that against the instances in the when array on the recurrence. It creates canceled event objects when there is an expected instance but it's missing from the when array.

takteek