views:

444

answers:

1

Hey everyone,

I know that you can retrieve events for a specified date range, but how can I retrieve events for one specified date (a single day)?

I tried setting both setStartMin() and setStartMax to the same date, but that doesn't work. It seems that there has to be at least one day in between Min and Max.

Here is the code I am using:

            $startDate='2009-07-23';
            $endDate='2009-07-23';

            $gdataCal = new Zend_Gdata_Calendar($client);
            $query = $gdataCal->newEventQuery();
            $query->setUser('default');
            $query->setVisibility('private');
            $query->setProjection('full');
            $query->setOrderby('starttime');
            $query->setStartMin($startDate);
            $query->setStartMax($endDate);
            $eventFeed = $gdataCal->getCalendarEventFeed($query);

Any ideas? Thanks...

EDIT:

Nevermind, I just found:

"Note that while the startMin is inclusive, startMax is exclusive, so specifying a startMax of '2007-08-01' will include those events up until 2007-07-31 11:59:59PM."

+1  A: 

For the sake of having this question marked as answered...

While StartMin is inclusive, StartMax is exclusive, which means that the date set as StartMax will not be included inside the range. If you want to have the events on one day, set StartMax as the next day, as such:

// Fetch all events for 2009-07-23
$query->setStartMin('2009-07-23');
$query->setStartMax('2009-07-24');
Andrew Moore