【问题标题】:Google Calendar API - Recurring Events Not WorkingGoogle Calendar API - 重复事件不起作用
【发布时间】:2011-04-28 01:59:32
【问题描述】:

所以我正在尝试使用 google data api 创建一个定期日历事件,但遇到了很多麻烦。当我去添加事件时,它只会添加事件的一个实例(第一天)。更奇怪的是,当我去删除它时,它会询问我是否要删除此重复中的所有事件(即使它存在之后没有!)。

这是我正在使用的 iCal 循环 VEVENT:

DTSTART;TZID=America/New_York:20110905T122000
DTEND;TZID=America/New_York:20110905T131000 
RRULE:FREQ=WEEKLY;UNTIL=20111222T230000;BYDAY=MO 

有什么想法吗?

【问题讨论】:

    标签: google-calendar-api google-data-api icalendar


    【解决方案1】:

    您也可以尝试在 RRULE 中指定 TZID,我认为这是必需的。

    【讨论】:

      【解决方案2】:

      我知道这是一个老问题,但是在.Net 中使用Google.Apis.Calendar.v3 时遇到了同样的问题。

      我发现当我指定 OriginalStartDateTime 时,我的 Recurrence 没有被评估。它会创建一个事件,但不会重复发生。

      解决方法很简单:取消OriginalStartDateTime。

      var e = new Event
              {
                  Description = "TEST EVENT",
                  Location = "Computer",
                  Summary = "Test Event. Safe to delete.",
                  Start = new EventDateTime{DateTime = new DateTime(2017,05,16, 3, 30, 00), TimeZone = "America/Chicago"}, // This is used as the OriginalStartTime
                  End = new EventDateTime{DateTime = new DateTime(2017,05,16, 4, 00, 00), TimeZone = "America/Chicago"}, // This is used as the OriginalStartTime
                  ICalUID = Guid.NewGuid().ToString(),
                  Organizer = new Event.OrganizerData
                  {
                      DisplayName = "Test Event"
                  },
                  Recurrence = new [] { "RRULE:FREQ=WEEKLY;BYDAY=TU,TH;UNTIL=20180701T170000Z" },
      
                  // When set, event does not repeat.
                  OriginalStartTime = null //  new EventDateTime{DateTime = new DateTime(2017,05,16), TimeZone="America/Chicago"}
              };
      
              ... GET SERVICE CODE ...
      
              var request = googleCalendarService.Events.Import(e, GoogleCalendarId);
              var result = request.Execute();
              return result;
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-08-10
        • 2013-07-06
        • 1970-01-01
        • 1970-01-01
        • 2019-08-22
        • 1970-01-01
        • 2014-06-21
        • 2012-02-10
        相关资源
        最近更新 更多