I have some code that has been running just fine for a while, but it
gives me trouble with a certain event. Maybe I'm doing something
wrong, so I'm totally open to suggestions. Here's what's going on:
first, I get all of the events for the upcoming week, like this:

$gdataCal = new Zend_Gdata_Calendar($client);
$query = $gdataCal->newEventQuery();
$query->setUser($whichCalendar . '%40group.calendar.google.com');
$query->setVisibility('private');
$query->setProjection('full');
$query->setOrderby('starttime');
$query->setSortOrder('ascending');
$query->setStartMin(date('Y-m-d', $startTS)); // today
$query->setStartMax(date('Y-m-d', $endTS));     // one week from today
$eventFeed = $gdataCal->getCalendarEventFeed($query);

Then I iterate over the event feed for each day of the week:

foreach($eventFeed as $event) {
        foreach($event->when as $when) {
                $startDate = strtotime($when->startTime);
                $endDate = strtotime($when->endTime);

                if(($startDate <= $theDateIWant) && ($endDate >= 
$theDateIWant)) {
                        break; // This event has at least one recurrence on 
$theDateIWant;
use it
                }
        }
}

This has been working fine, but maybe this is totally the wrong way to
do it? The problem I'm seeing is this: I have a recurring event in my
calendar that started on 8/11/09:18:00:00. It recurs once a week, and
it shows up fine on calendar.google.com, repeating on the 18th and the
25th. But if I call getCalendarEventFeed() for 8/19/09:00:00:00 -
8/26/09:00:00:00 then the event in the event feed has only one 'when':
the 18th! I don't get why this out-of-range 'when' is showing up, and
not one for the 25th. If I artificially check for an eight-day range,
8/19/09 - 8/27/09, then I get two 'whens': the weird 18th again, and
one for the 25th. None of my other recurring events are misbehaving in
this way. I tried deleting the event from the calendar and re-creating
it, but it still behaves the same. Anyone have any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to