Getting EXDATE to work when creating Google recurring event - google-calendar-api

I am trying to import a recurring calendar event using a RRULE plus EXDATE to exclude a date. I thought I had this working a while ago, but it seems to not work any more, at least for this example. The problem is the EXDATE is ignored. See below for sample json. I am trying to exclude the first instance, which begins on June 17, 2019. The date is in Zulu and should match the start date of the event, i.e. 0900 Chicago is 1400 GMT. I have tried including the TZID value of America/Chicago, putting the time in local time (without the Z) and also varying the time up and down by one hour. Google won't budge, the first date is always included in the series. What am I doing wrong?
{
"summary": "Test Meeting 01",
"description": "\n",
"location": "",
"iCalUID": "B8537ED49F7A60558625840A00697C87-Lotus_Notes_Generated-1559329993",
"start": {
"dateTime": "2019-06-17T09:00:00-05:00",
"timeZone": "America/Chicago"
},
"end": {
"dateTime": "2019-06-17T10:00:00-05:00",
"timeZone": "America/Chicago"
},
"recurrence": [
"EXDATE:20190617T140000Z",
"RRULE:FREQ=DAILY;COUNT=3;INTERVAL=1"
],
"attendees": [
],
"visibility": "default"
}

I've been struggling to get EXDATE working too. For me, using local time without TZID or Z worked, i. e.
EXDATE:20190617T090000
for your case.
P.S. This API piece seems really buggy, thus I'll mention that in my case calendar has the same timezone as the event. I do hope, that it does not matter.

Related

Update recurring event after a date

my name is Erick and I'm doing an integration with google calendar.
I need to update the information (without changing the date) of a recurring event from a date other than the first, and I need the changes to be applied in the following schedules.
Ex: Recurring scheduling 2020-07-20 through 2020-07-30
change the summary from the 23rd onwards
call PUT
https://www.googleapis.com/calendar/v3/calendars/{{id}}/events/{{event_id}}
{
"summary": "TESTE 123",
"start": {
"dateTime": "2020-07-23T19:00:00",
"timeZone": "America/Sao_Paulo"
},
"end": {
"dateTime": "2020-07-23T20:00:00",
"timeZone": "America/Sao_Paulo"
}, "recurrence":[
"RRULE:FREQ=DAILY;UNTIL=20200730T235959Z;BYDAY=MO,TU,WE,TH,FR,SA"
]
}
The problem is that when doing it, the days 20, 21 and 22 are excluded,
When there is a change of dates I call the PUT and then the POST to create the other schedules, however, in this case there is no change of date and I cannot miss the recurrence.
I really need some help on this issue, this one, thank you

What are the accepted datetime format in outlook api while creating events?

I am trying to create an event using Microsoft Graph API. The thing which is a bit confusing are date type parameters such as start which is of type dateTimeTimeZone which has two properties, dateTime and timeZone.
{
"subject": "Test body event graph api ist 1",
"start": {
"dateTime": "2018-01-09T12:00:00",
"timeZone": "India Standard Time"
},
"end": {
"dateTime": "2018-01-09T14:00:00",
"timeZone": "India Standard Time"
},
}
For example, I used the above listed values of start and end datetime. That means the event should be created with start date as 9th,January,2018 and time as 12:00:00 pm IST while it should end in 2:00:00 pm IST. However if I look into my calendar the event was scheduled to start at 6:30 am IST and ending at 8:30 am IST. I cannot understand this behaviour. Can someone explain this?
So what does the two parameters dateTime and timeZone specify? What are the valid dateTime accepted formats and does dateTime format needs to match to the timeZone?
Can someone please explain these things?
You can get a list of supported time zones in the beta version of the Graph API:
GET /me/outlook/supportedTimeZones
The value you are using (India Standard Time) is a valid value, so this should work. I just tried it and it worked correctly.
REQUEST
POST /me/events
{
"subject": "Test India Appt",
"start": {
"dateTime": "2018-01-09T12:00:00",
"timeZone": "India Standard Time"
},
"end": {
"dateTime": "2018-01-09T14:00:00",
"timeZone": "India Standard Time"
}
}
RESPONSE (truncated)
{
...
"originalStartTimeZone": "India Standard Time",
"originalEndTimeZone": "India Standard Time",
...
"subject": "Test India Appt",
...
"start": {
"dateTime": "2018-01-09T12:00:00.0000000",
"timeZone": "India Standard Time"
},
"end": {
"dateTime": "2018-01-09T14:00:00.0000000",
"timeZone": "India Standard Time"
},
...
}
When you say that you looked at your calendar, how did you do that exactly? Depending on the client you used, the display may have been adjusted to a different time zone.
For example, in the Outlook web client, you set your time zone to a specific one and all events are shown relative to that time zone on your calendar. My test user that I created this appointment with has their time zone set to Pacific Standard Time, so when I look at my calendar, the event I created shows as starting at 10:30 PM on 1/8 and ending at 12:30 AM on 1/9.
Outlook desktop client also shows events relative to the user's time zone, but it uses the time zone of the OS rather than relying on its own setting.

Last workday before date

I want to set a monthly recurring event (or reminder) in Google calendar for the last workday (i.e. excluding weekends) before a specific date. For example, if 22 Oct is on Sunday, I want 20 Oct (Friday), but if it's on Tuesday, I want this one.
As a plus, can the holidays be excluded, too?
This would work for the 22nd of every month. RRULE:FREQ=MONTHLY;WKST=MO;BYMONTHDAY=20,21,22;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1
You can do this by setting the correct RRULE for the recurrence.
You can check this related SO post I've answered for creating a recurring "Event every fourth Wednesday in August" and this tutorial : Create a repeating event on last day of each month on Google Calendar for code implementation reference.
{
"summary": "Event Last Day of the Month",
"recurrence": [
"RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1;WKST=MO"
],
"start": {
"dateTime": "2017-08-31T6:00:00",
"timeZone": "timeZone"
},
"end": {
"dateTime": "2017-08-31T7:00:00",
"timeZone": "timeZone"
}
}
Hope this helps.

Wrong date of recurring events are added in google calendar

When I add an recurring event from one timezone, the UNTIL date shows correctly but the events shown are wrong
For example,
{
"end":
{ "dateTime": "2017-09-26T22:10:00", "timeZone": "America/New_York" },
"start":
{ "dateTime": "2017-09-26T21:50:00", "timeZone": "America/New_York" },
"recurrence": [ "RRULE:FREQ=DAILY;UNTIL=20170929;" ],
"summary": "LEAVE. ",
"location": "New Tover"
}
When I add this, it shows till 28 only but not till 29.
If I set it as a day extra, it takes my offset value of timezone and recurring event differs while adding.
For example, if my timezone is Asia/Culcutta, and if i add a recurring event anytime between morning 12am-5:30am, it shows till 30th and other events till 29th. Please help.

Google Calendar API, RRULE and EXDATE

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.
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).
For others who come across similar situations,
EXDATE;TZID=America/New_York:20140905T103000
should work.

Resources