0

I already have an event entry that I created from my custom calendar with the following RRULE

FREQ=WEEKLY;DTSTART=20201203T090000;INTERVAL=2;BYDAY=TH;EXDATE:20201203T090000

When I update the event without changing the rrule I get an error

Error Message: Google_Service_Exception: { "error": { "errors": [ { "domain": "global", "reason": "invalid", "message": "Invalid recurrence rule." } ], "code": 400, "message": "Invalid recurrence rule." } }

The only thing I can think of is that this rrule has dates in the past. Can anyone confirm that this would be the issue?

Marten
  • 3,802
  • 1
  • 17
  • 26
DeanO
  • 93
  • 1
  • 10
  • When you use the [Try this API](https://developers.google.com/calendar/v3/reference/events/get), setting `fields` to `recurrence`: what does the response exactly look like? – ziganotschka Dec 11 '20 at 09:20

1 Answers1

1

FREQ=WEEKLY;DTSTART=20201203T090000;INTERVAL=2;BYDAY=TH;EXDATE:20201203T090000 is not a valid recurrence rule. With all the invalid parts removed the rule would look like this:

FREQ=WEEKLY;INTERVAL=2;BYDAY=TH

DTSTART and EXDATE are separate properties.

Marten
  • 3,802
  • 1
  • 17
  • 26
  • `DTSTART` and `EXDATE` can be used within `RRULE` for Google Calendar API, it is just about getting the right syntax, which is different depending on the event parameters, see e.g. [here](https://stackoverflow.com/questions/25170070/google-calendar-api-rrule-and-exdate). – ziganotschka Dec 11 '20 at 11:21
  • 1
    @ziganotschka can you show a working example to back this claim? [Google's Calendar API](https://developers.google.com/calendar/v3/reference/events/insert#recurrence) is pretty clear about that. It says `Note that DTSTART and DTEND lines are not allowed in this field;` and refers to [RFC 5545](https://tools.ietf.org/html/rfc5545) regarding the format of each of the lines in the array. – Marten Dec 12 '20 at 13:52