OfficeDev / ews-managed-api

Other
584 stars 316 forks source link

resetting recurrence pattern not reinstate deleted ocurrence #235

Open chopraniitn opened 4 years ago

chopraniitn commented 4 years ago

Hi,

i am having an issue with setting recurrence pattern using EWS.

i create a recurring meeting using EWS from 02-12-2019 to 06-12-2019 and its a daily pattern. meeting was created fine.

Now using EWS, i canceled one of the occurrence for example 06-12-2019 and occurrence was cancelled.

Now i extended the whole recurring meeting to 08-12-2019 using EWS. it changed the end date, but it did not reinstated deleted occurrence.

As a general behavior in outlook if you extend the meeting it does bring back the deleted ocuurence. not sure what i need to change whilst setting recurrence pattern to bring back the deletedoccurrence.

this is how i generate recurrence pattern appointment.Recurrence = getRecurrencePatern(startDate, endTime, recurrencePattern);

public Recurrence getRecurrencePatern(startDate, endTime, recurrencePattern) { Recurrence.DailyPattern dailyPattern = new Recurrence.DailyPattern(startDate, recurrencePattern.Interval); return RecurrencePatternUtil.AddGenericPattern(dailyPattern, recurrencePattern, endTime, destTimeZone); }

public static Recurrence AddGenericPattern(Recurrence recurrence, RecurrencePattern recurrencePattern, DateTime endTime, TimeZoneInfo destTimeZone) {

        if (recurrencePattern.NumberOfOccurrences != 0)
        {
            recurrence.NumberOfOccurrences = recurrencePattern.NumberOfOccurrences;
            return recurrence;
        }

        if (recurrencePattern.EndDate != null)
        {
            DateTime endDate = GenerateRecurrenceDateTime(recurrencePattern.EndDate, endTime, destTimeZone);
            recurrence.EndDate = endDate;
        }
        return recurrence;
    }`