2
votes

So I'm trying to create a recurring calendar event with the google data api, and I am having a lot of trouble. When I go to add the event, it only will add one instance (the first day) of the event. What's even weirder is when I go to delete it, it asks me if I want to delete all events in this recurrence (even though none after it exist!).

Here is the iCal recurring VEVENT I'm using:

DTSTART;TZID=America/New_York:20110905T122000
DTEND;TZID=America/New_York:20110905T131000 
RRULE:FREQ=WEEKLY;UNTIL=20111222T230000;BYDAY=MO 

Any thoughts?

2

2 Answers

0
votes

You might try specifying TZID in the RRULE as well, I believe it's required.

0
votes

I know this is an old question, but while using Google.Apis.Calendar.v3 in .Net I encountered the same issue.

I discovered that when I specified OriginalStartDateTime my Recurrence was not being evaluated. It would create an event, but not the recurrence.

The resolution was pretty simple: nullify OriginalStartDateTime.

var e = new Event
        {
            Description = "TEST EVENT",
            Location = "Computer",
            Summary = "Test Event. Safe to delete.",
            Start = new EventDateTime{DateTime = new DateTime(2017,05,16, 3, 30, 00), TimeZone = "America/Chicago"}, // This is used as the OriginalStartTime
            End = new EventDateTime{DateTime = new DateTime(2017,05,16, 4, 00, 00), TimeZone = "America/Chicago"}, // This is used as the OriginalStartTime
            ICalUID = Guid.NewGuid().ToString(),
            Organizer = new Event.OrganizerData
            {
                DisplayName = "Test Event"
            },
            Recurrence = new [] { "RRULE:FREQ=WEEKLY;BYDAY=TU,TH;UNTIL=20180701T170000Z" },

            // When set, event does not repeat.
            OriginalStartTime = null //  new EventDateTime{DateTime = new DateTime(2017,05,16), TimeZone="America/Chicago"}
        };

        ... GET SERVICE CODE ...

        var request = googleCalendarService.Events.Import(e, GoogleCalendarId);
        var result = request.Execute();
        return result;