Google Calendar API-在日期之后更新周期性事件
我正在与Google日历集成.
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.
例如:从2020-07-20到2020-07-30的定期调度
Ex: Recurring scheduling 2020-07-20 through 2020-07-30
从23日起更改摘要
致电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"
问题在于,这样做时,排除了第20、21和22天,
The problem is that when doing it, the days 20, 21 and 22 are excluded,
当日期发生变化时,我先调用PUT,然后再通过POST来创建其他时间表,但是,在这种情况下,日期没有变化,因此我不能错过重复发生的时间.
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.
我的方法是google-calendar-api
-
首先编辑原始重复事件,将其限制为您不希望出现的日期 改变.为此,请将
RRULE
的UNTIL
组件设置为指向第一个目标实例的开始时间之前
First edit the original recurring event, limiting it to the date until which you want no change. Do this by setting the
UNTIL
component of theRRULE
to point before the start time of the first target instance
然后使用更改的信息创建一个new recurring event
.
Then create a new recurring event
with changed info.
您可以从此文档中获得更好的主意:部分修改重复发生的事件
You can get a better idea from this doc: Modify Recurring Event Partially