Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2007
    Thanked 0 Times in 0 Posts

    Question show days(dates) on screen

    the following function brings back all events in my google calendar between 2 dates (which I have set manually) 2 weeks from today

    I would like to write out each day even if it does have an event

    at the moment it only writes out a line with an event
    PHP Code:

    function outputCalendarByDateRange($client$startDate='2007-05-01'
    $gdataCal = new Zend_Gdata_Calendar($client);
    $query $gdataCal->newEventQuery();
    $eventFeed $gdataCal->getCalendarEventFeed($query);
      foreach (
    $eventFeed as $event) {
    "\t<li>" $event->title->text .  " (" $event->id->text ")\n";
        foreach (
    $event->when as $when) {
    "\t\t\t<li>Starts: " $when->startTime "</li>\n";


  • #2
    Senior Coder
    Join Date
    Jun 2008
    New Jersey
    Thanked 259 Times in 256 Posts
    Wait... do you mean you want to write the date even if it DOESN'T have an event? Basically display a 2 week itinerary, showing the events on each date (showing nothing if there are no events)?

    If so, then you need to first sort the events' data into arrays, loop through the days, and check if the array contains any events on that day, displaying each day as you go. You'd probably want to use something like creating 2 arrays: one with all the data (ie, store each event object as an element in an array), and one array that contains the data's key in array 1 associated to the date of the event. So then you can use array_keys to search array 2 for the dates, getting back the appropriate keys pointing to the events in array 1, looping through those to get all the events on that day.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts