【问题标题】:parsing recurrence Google Calendar API解析循环 Google Calendar API
【发布时间】:2016-12-11 19:54:34
【问题描述】:

我正在尝试创建可与用户 Google 日历数据一起使用的小型网络应用程序。除了 getting start datetime 对于 item.keys() 中带有 'recurrence' 的事件外,一切正常。

问题:如何从给定数据中获取事件的开始时间:

{'kind': 'calendar#event', 
'sequence': 0, 
'htmlLink': 'link', 
'creator': {my info}, 
'location': '...', 
'summary': '...', 
'etag': '"etag"', 
'organizer': {org_info}, 
'status': 'confirmed', 
'reminders': {'useDefault': True}, 
'created': '2016-09-18T07:02:56.000Z', 
'id': event_id, 
'iCalUID': 'iCalUID', 
'start': {'timeZone': 'Europe/Moscow', 'dateTime': '2016-09-07T14:35:00+03:00'}, 
'updated': '2016-09-18T07:02:56.612Z', 
'description': '...', 
'recurrence': ['RRULE:FREQ=WEEKLY;WKST=SU;INTERVAL=2;BYDAY=WE'], 
'end': {'timeZone': 'Europe/Moscow', 'dateTime': '2016-09-07T16:10:00+03:00'}}

我的想法是以某种方式解析 RRULE,我找到了从中获取日期时间列表的方法,但是如何获取 this 事件开始时间对我来说仍然是个问题。

我正在使用 service.events().list(...).execute() 获取数据

我知道在 new API 中(我今天才发现这个)项目有很好的名称 originStartTime,但旧事件没有。

【问题讨论】:

    标签: python google-calendar-api rrule


    【解决方案1】:

    StackOverflow 的魔力:我试图找到解决方案 2 天,但在发布问题后,我发现了完全符合我需要的方法或函数events().instances()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-07
      • 2013-01-02
      相关资源
      最近更新 更多