0
votes

I'm trying to create a recurrence rule with the Google Calendar Api.

 [JAVASCRIPT - Google Client Library]
 var req = gapi.client.calendar.events.insert({
  [...],
  "recurrence": [
    "RRULE:FREQ=WEEKLY;UNTIL="+date.toISOString()
  ],
  [...]
 });
 req.execute();

The code above return 400 Bad request, because the recurrence rule is not correctly formatted.

I don't understand how to create a correct date format for the UNTIL field.

I've tried to use a date object and use the ISO conversion but it doesn't work either.

Anyway a single creation for the event works correctly and also a repeat with a COUNT field.

FILE ON GITHUB

1

1 Answers

1
votes

There are several rules that apply to UNTIL. First of all, it is not an ISO string but of value DATE or DATE-TIME (http://tools.ietf.org/html/rfc5545#section-3.3.5). Then you need to pay attention that the DATE value is used if the recurring event start is all-day event and vice versa. At last you need to pay attention to Timezone. The UNTIL must be in the same timezone as your start. I really recommend reading about recurrence rules in the RFC http://tools.ietf.org/html/rfc5545#section-3.8.5.3