For our product we are using Telerik RadScheduler to display user calendar information, which we make extensive use of the Telerik.Web.UI.RecurrenceRule implementation. Additionally we are now integrating with Google Calendar to display and edit external events within our application. There have been several recurrence rules returned from Google that follow the iCalendar standard but RecurrenceRule has failed to parse correctly. Below are some examples of rules that have issues: 1. EXDATE value is ignored: DTSTART:20160405T120000Z DTEND:20160405T130000Z RRULE:FREQ=DAILY;INTERVAL=4;BYDAY=MO,TU,WE,TH,FR,SA,SU EXDATE;VALUE=DATE-TIME:20160413T120000Z 2. INTERVAL is ignored (interval of 1 is assigned when parsed by Telerik) DTSTART:20160404T120000Z DTEND:20160404T130000Z RRULE:FREQ=DAILY;COUNT=10;INTERVAL=4 3. Parse fails completely: DTSTART:20160404Z DTEND:20160405Z RRULE:FREQ=WEEKLY;UNTIL=20160509Z;BYDAY=MO;INTERVAL=1
Hello Charles,
The reason for the parse failure is most probably related to the different RFC specifications. The RadScheduler uses RFC 2445 one, which has a slightly different syntax:
For example, the first rule failed because of the Exdate:
1) It expects a colon instead of a semi-colon;
2) It needs only the date, without the Value and Date-Time you have shared;
Working rule:
string strRule =
@"DTSTART:20160405T120000Z
DTEND:20160405T130000Z
RRULE:FREQ=DAILY;INTERVAL=4;BYDAY=MO,TU,WE,TH,FR,SA,SU
EXDATE:20160413T120000Z";
The second rule is missing the BYDAY option. If you add it, it will work properly.
DTSTART:20160404T120000Z DTEND:20160404T130000Z RRULE:FREQ=DAILY;COUNT=10;INTERVAL=4;BYDAY=MO,TU,WE,TH,FR,SA,SU
The third rule needs the time included in the Date as well
DTSTART:20160404T000000Z DTEND:20160405T000000Z RRULE:FREQ=WEEKLY;UNTIL=20160509T000000Z;BYDAY=MO;INTERVAL=1
If you are using the Recurrence parser outside the RadScheduler control, you can create your own parser based on the built-in one and handle the differences in the used RFC specification. You can access the source code of the controls from your account:
Regards,
Peter Milchev
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.