8

I'm trying to export some events to Google Calendar with the API, specifically the python library that wraps it. These events have recurrence, which is defined to Google Calendar with an RRULE string, and I'm trying to exclude certain dates with EXDATE strings.

Here's what I'm sending:

{
    "summary": "Test Event", 
    "description": "Event", 
    "location": "Home", 
    "start": {
        "timeZone": "America/New_York", 
        "dateTime": "2014-09-05T10:30:00"
    }, 
    "end": {
        "timeZone": "America/New_York", 
        "dateTime": "2014-09-05T11:35:00"
    }, 
    "recurrence": [
        "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=FR;UNTIL=20141203T173500Z", 
        "EXDATE:20141002"
    ], 
}

It exports all correctly, except the EXDATE isn't respected. Well, it's sort of respected. In the calendar, the event still exists, however it describes the repetition as "Weekly at 10:30am on Monday, Wednesday, Thursday from Wed Sep 3 to Wed Dec 3 except Thu Oct 2".

The "except Thu Oct 2" part implies it is parsing the EXDATE correctly (and if I send garbage in the EXDATE, it won't run, so it is parsing it), but the event still occurs.

fishsticks
  • 703
  • 1
  • 6
  • 16

2 Answers2

14

EXDATE must be in the same format as the start and end. That means if the start is an event with time, the EXDATE must also have the time specified. I recommend reading on this in the rfc 5545 (https://www.rfc-editor.org/rfc/rfc5545).

Community
  • 1
  • 1
luc
  • 3,642
  • 1
  • 18
  • 21
  • Aha, thank you. I had tried adding times to it before, but it didn't occur to me that it has to be exactly the start time of the event, too. – fishsticks Aug 07 '14 at 16:12
4

For others who come across similar situations,

EXDATE;TZID=America/New_York:20140905T103000

should work.

Rajitha Bandara
  • 743
  • 1
  • 10
  • 16