Search code examples
phpphp-ews

EWS-PHP : get all recurring calendar item


With the EWS-PHP library, I am able to get all events on my Exchange calendar. But I noticed that when there is recurring event, I got only the first occurrence event, and this happens when the CalendarItem has "RecurringMaster" for the "CalendarItemType" property.

My question is how to get all occurrences of a recurring event, in PHP way ?


Solution

  • when setting your start and end dates make sure you set an end date in the distant future:

    $request->CalendarView = new EWSType_CalendarViewType();
    $start=strtotime("today - 6 months");
    $end=strtotime("today + 6 months");
    $request->CalendarView->StartDate = date_iso8601($start); // an ISO8601 date e.g. 2012-06-12T15:18:34+03:00
    $request->CalendarView->EndDate = date_iso8601($end); // an ISO8601 date later than the above
    

    it will only display recurring events that are within your selected dates.