Could you post the unfiltered results that you are getting? Your code
looks ok, but you could be getting results that are different than you
expect because you have recurring events.

Ray

On Fri, Mar 13, 2009 at 6:33 AM, RMD <[email protected]> wrote:
>
>
> Thanks, I did exactly that, but the $query->setOrderby('starttime');
> doesn't seem to have any effect
>
>
> The whole function
>
> function outputCalendarByDateRangeFull($client, $startDate, $endDate)
>                        {
>                          global $formattedEvents;
>                          $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);
>                          //$i is for making the eventarray
>                          $i=0;
>
>                          foreach ($eventFeed as $event) {
>                                                //Title
>                                                  $title_data = 
> stripslashes($event->title);
>                                                  $title_stripped = 
> strip_tags($title_data);
>                                                  //echo $title_stripped;
>
>
>                                                //Start End
>
>                                                                foreach 
> ($event->when as $when) {
>                                                                  //Starts
>                                                                  
> $startofevent = $when->startTime;
>                                                                  
> $startofevent = str_replace('.000-05:00', "",
> $startofevent);
>                                                                  
> list($startdateevent, $starttimeevent) = split('T',
> $startofevent);
>                                                                               
>  //Pick out Start Day
>                                                                               
>  list($year, $month,$day) = split('-', $startdateevent);
>                                                                               
>  //Pick out Start Time
>                                                                               
>  list($hour,$minute,$second) = split(':', $starttimeevent);
>
>                                                                               
>  $newStartDay = date("F j, Y", mktime ($hour, $minute,
> $second,$month,$day,$year));
>                                                                               
>  $newStartTime = date("g:i a", mktime($hour, $minute, $second,
> $month,$day,$year));
>
>                                                                  //Ends
>                                                                  $endofevent 
> = $when->endTime;
>                                                                  $endofevent 
> = str_replace('.000-05:00', "", $endofevent);
>                                                                  
> list($endDateEvent, $endTimeEvent) = split('T',
> $endofevent);
>                                                                               
>  //Pick out Start Day
>                                                                               
>  list($year2, $month2,$day2) = split('-', $endDateEvent);
>                                                                               
>  //Pick out Start Time
>                                                                               
>  list($hour2,$minute2,$second2) = split(':', $endTimeEvent);
>
>                                                                               
>  $newEndDay = date("F j, Y", mktime ($hour2, $minute2,
> $second2,$month2,$day2,$year2));
>                                                                               
>  $newEndTime = date("g:i a", mktime($hour2, $minute2,
> $second2,$month2,$day2,$year2));
>
>                                                                  //Put Events 
> into Array for XML export
>                                                                  
> $formattedEvents[] = array (
>                                                                               
>          "$i" => array("title" => $title_stripped, "date" =>
> $newStartDay, "start"  => $newStartTime, "end" => $newEndTime)
>                                                                               
>          );
>
>                                                                  $i++;
>
>                                                                }//Ends 
> foreach ($event->when as $when)
>
>                                                }//Ends foreach ($eventFeed as 
> $event)
>
>                        }//Ends function outputCalendarByDateRangeFull
> >
>

--~--~---------~--~----~------------~-------~--~----~
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