为什么在 Google 日历中使用 singleEvents=false 时会列出重复事件的已编辑实例?
Why are edited instances of recurrent events listed when using singleEvents=false in Google Calendar?
我创建了一个周期性事件,重复 3 天。
然后当我搜索时使用:
calendarService.events().list("primary").setTimeMin(min).setTimeMax(max).setSingleEvents(false).setShowDeleted(false).execute();
我只得到基础的重复事件:
Event ID: cq61agdr4sbdnfj7rfbpbk2pro
Summary: Google Calendar API test event
Status: confirmed
Event Start/End: {"dateTime":"2017-05-17T15:24:53.000+02:00","timeZone":"Europe/Berlin"} {"dateTime":"2017-05-17T16:24:53.000+02:00","timeZone":"Europe/Berlin"}
Recurrence: [RRULE:FREQ=DAILY;COUNT=3]
RecurringEventId: null
到目前为止一切顺利,但是当我(通过 Google 日历网页)只编辑其中一个重复项,并重复之前相同的搜索时,我也得到了编辑后的事件(第二个,你可以看到我更改了摘要):
Event ID: cq61agdr4sbdnfj7rfbpbk2pro
Summary: Google Calendar API test event
Status: confirmed
Event Start/End: {"dateTime":"2017-05-17T15:24:53.000+02:00","timeZone":"Europe/Berlin"} {"dateTime":"2017-05-17T16:24:53.000+02:00","timeZone":"Europe/Berlin"}
Recurrence: [RRULE:FREQ=DAILY;COUNT=3]
RecurringEventId: null
Event ID: cq61agdr4sbdnfj7rfbpbk2pro_20170518T132453Z
Summary: foo bar Google Calendar API test event
Status: confirmed
Event Start/End: {"dateTime":"2017-05-18T15:24:53.000+02:00","timeZone":"Europe/Berlin"} {"dateTime":"2017-05-18T16:24:53.000+02:00","timeZone":"Europe/Berlin"}
Recurrence: null
RecurringEventId: cq61agdr4sbdnfj7rfbpbk2pro
为什么我在 setSingleEvents(false)
的查询中得到了实例更改后的重复事件实例?
这是预期的行为。尚未找到明确解释日历事件行为的文档,但根据您提供的详细信息和参数的描述:
Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False.
如果重复事件的实例被修改,它将被视为不同于通常的重复事件(即单个一次性事件),使 Recurrence
为空,我认为这是检查事件是否有资格为 singleEvents
返回的参数,而 RecurringEventId
用于跟踪从中重复出现的事件它最初来自的事件。
我创建了一个周期性事件,重复 3 天。
然后当我搜索时使用:
calendarService.events().list("primary").setTimeMin(min).setTimeMax(max).setSingleEvents(false).setShowDeleted(false).execute();
我只得到基础的重复事件:
Event ID: cq61agdr4sbdnfj7rfbpbk2pro
Summary: Google Calendar API test event
Status: confirmed
Event Start/End: {"dateTime":"2017-05-17T15:24:53.000+02:00","timeZone":"Europe/Berlin"} {"dateTime":"2017-05-17T16:24:53.000+02:00","timeZone":"Europe/Berlin"}
Recurrence: [RRULE:FREQ=DAILY;COUNT=3]
RecurringEventId: null
到目前为止一切顺利,但是当我(通过 Google 日历网页)只编辑其中一个重复项,并重复之前相同的搜索时,我也得到了编辑后的事件(第二个,你可以看到我更改了摘要):
Event ID: cq61agdr4sbdnfj7rfbpbk2pro
Summary: Google Calendar API test event
Status: confirmed
Event Start/End: {"dateTime":"2017-05-17T15:24:53.000+02:00","timeZone":"Europe/Berlin"} {"dateTime":"2017-05-17T16:24:53.000+02:00","timeZone":"Europe/Berlin"}
Recurrence: [RRULE:FREQ=DAILY;COUNT=3]
RecurringEventId: null
Event ID: cq61agdr4sbdnfj7rfbpbk2pro_20170518T132453Z
Summary: foo bar Google Calendar API test event
Status: confirmed
Event Start/End: {"dateTime":"2017-05-18T15:24:53.000+02:00","timeZone":"Europe/Berlin"} {"dateTime":"2017-05-18T16:24:53.000+02:00","timeZone":"Europe/Berlin"}
Recurrence: null
RecurringEventId: cq61agdr4sbdnfj7rfbpbk2pro
为什么我在 setSingleEvents(false)
的查询中得到了实例更改后的重复事件实例?
这是预期的行为。尚未找到明确解释日历事件行为的文档,但根据您提供的详细信息和参数的描述:
Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False.
如果重复事件的实例被修改,它将被视为不同于通常的重复事件(即单个一次性事件),使 Recurrence
为空,我认为这是检查事件是否有资格为 singleEvents
返回的参数,而 RecurringEventId
用于跟踪从中重复出现的事件它最初来自的事件。