none
How parse to Google Calendar Recurrence Rule for Exchange ? RRS feed

  • Question

  • I am writing a migration tool which uses Gmail Api and EWS managed Api.  I ran into a problem of parsing Calendar Recurrence Rule. All I am getting from google Calendar  Api is nothing but a string of RRULE, EXRULE, RDATE and EXDATE for a recurring event. For example :

    RRULE:FREQ=WEEKLY;UNTIL=20110701T170000Z

    How can I parse this rules to EWS manged Api Recurring event  functions ? EWS managed Api has various sets of functions for creating Recurring events. Any help would be highly appreciated. Maybe some third party library I can use for the same ?

    Tuesday, February 24, 2015 9:43 AM

Answers

  • Hi SharpDragon,

    In the RFC documentation in Chapter 4.3.10 Recurrence Rule you can find the RFC definitions. The "FREQ"-Element maps to the Child-Class of the linked frequency pattern (Except Yearly, which is another child class of the Base pattern and Intervals shorter than one day, which are not supported by Exchange).

    For the other options, their terminology is defined in the same chapter and you'll need to match them to the respective properties (which will require a lot of Legwork, but will not be complex).

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Tuesday, February 24, 2015 1:55 PM

All replies

  • Hi SharpDragon,

    can't tell you about the gmail api. I assume you know how to extract information from strings, so let's jump right into EWS MA Api:

    You want to use an Interval.Pattern for this (since the alternatives are yearly intervals).

    You'll probably need to set the interval to 7 for a weekly frequency.

    Finally you convert the UNTIL Timestamp to a DateTime object:

    DateTime.ParseExact("20110701T170000Z", "yyyyMMddTHHmmssZ", System.Globalization.CultureInfo.InvariantCulture)

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Tuesday, February 24, 2015 10:48 AM
  • RRULE:FREQ=WEEKLY;UNTIL=20110701T170000Z

    Actually, that's my problem. I don't how to parse the Recurrence rule strings into the follow patterns and functions.

    YearPattern, WeeklyPattern, DailyPattern, RelativeMonthly Pattern, RelativeYear Pattern etc.. and StartDate,Enddate, Noofoccurrences , hasEnd functions.   Gmail Api is only giving me a RRule and EXRule etc. in RFC2445 format. I am wondering if there is a way to parse RFC2445 Recurrence rules.

    Tuesday, February 24, 2015 1:38 PM
  • Hi SharpDragon,

    In the RFC documentation in Chapter 4.3.10 Recurrence Rule you can find the RFC definitions. The "FREQ"-Element maps to the Child-Class of the linked frequency pattern (Except Yearly, which is another child class of the Base pattern and Intervals shorter than one day, which are not supported by Exchange).

    For the other options, their terminology is defined in the same chapter and you'll need to match them to the respective properties (which will require a lot of Legwork, but will not be complex).

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Tuesday, February 24, 2015 1:55 PM