Google Calendar API,RRULE和EXDATE [英] Google Calendar API, RRULE and EXDATE

查看:242
本文介绍了Google Calendar API,RRULE和EXDATE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用API​​将某些事件导出到Google日历,特别是将其包装的python库.这些事件具有重复性,已使用RRULE字符串定义到Google日历,并且我尝试使用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.

这是我要发送的内容:

{
    "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"
    ], 
}

除了不遵守EXDATE之外,它都能正确导出所有内容.好吧,这是一种尊重.在日历中,该事件仍然存在,但是将重复描述为每周9月3日,星期三,星期四上午10:30,从10月2日星期三至12月3日星期三"(星期四除外).

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".

"10月2日星期四除外"部分表示它正在正确解析EXDATE(并且如果我在EXDATE中发送垃圾,它将无法运行,因此它将在解析它),但是

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必须采用与开始和结束相同的格式.这意味着,如果开始是一个有时间的事件,则EXDATE也必须指定时间.我建议在rfc 5545( http://tools.ietf.org/html/rfc5545).

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).

这篇关于Google Calendar API,RRULE和EXDATE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆