Google Calendar API, RRULE and EXDATE

人盡茶涼 提交于 2019-12-07 01:52:40

问题


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.


回答1:


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 (http://tools.ietf.org/html/rfc5545).




回答2:


For others who come across similar situations,

EXDATE;TZID=America/New_York:20140905T103000

should work.



来源:https://stackoverflow.com/questions/25170070/google-calendar-api-rrule-and-exdate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!