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.
Related
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
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.
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.
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.
There's an all-day event on Google calendar, I pulled it, change it to 1-hour event, I created patch event to push back. As I understand, an all-day event has "start" as a Date, and "end" as the following date. Time-limited event have those in DateTime.
So in my patch, I tried changing those values from Date to DateTime. However, I always receive the error "Invalid or mismatching start and end times".
I tried this manually on Google Calendar API site: https://developers.google.com/google-apps/calendar/v3/reference/events/patch#try-it
and getting the same error. If I take a time-limited event and modify it, no trouble occurs. I believe this is a bug in the API itself. Anyone experiences it and what's the workaround?
Thanks in advance.
Updated: this is what I received from google dev team, hope useful to sb:
Comment #4 on issue 3110 by stanc...#google.com: patching event from all-day to non all-day failed
http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3110
Patch operation takes the original event and changes/adds/removes entries specified by the request. If you send following request to PATCH operation against all-day event:
{
"start": {
"dateTime": "2012-05-17T06:30:00+06:30",
"timeZone": "UTC"
},
"end": {
"dateTime": "2012-05-17T07:30:00+06:30",
"timeZone": "UTC"
}
}
the resulting event would end-up with both dateTime and date fields set (which is not allowed). Hence, the PATCH request needs to clear the date fields:
{
"start": {
"dateTime": "2012-05-17T06:30:00+06:30",
"timeZone": "UTC",
"date": null
},
"end": {
"dateTime": "2012-05-17T07:30:00+06:30",
"timeZone": "UTC",
"date": null
}
}
In code, when you want to set the field Date to null, you have to put Data.NULL_DATE_TIME like this:
EventDateTime edt = new EventDateTime();
edt.put("date",Data.NULL_DATE_TIME);// if you put NULL, it doesn't retain.
edt.put("dateTime", newTime); //newTime is the new value you want to set, type DateTime
Use the patch https://github.com/google/google-api-php-client/pull/484
It will help you.