2011-04-28 53 views
2

因此,我試圖用google數據api創建週期性日曆事件,而且我遇到了很多麻煩。當我去添加事件時,它只會添加事件的一個實例(第一天)。更奇怪的是,當我刪除它時,它會問我是否要刪除此次重複中的所有事件(即使沒有任何事件存在!)。Google Calendar API - 週期性事件不起作用

這裏是經常性的iCal VEVENT我使用:

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

有什麼想法?

回答

0

您也可以嘗試在RRULE中指定TZID,我相信這是必需的。

0

我知道這是一個老問題,但因爲我最近才遇到了同樣的問題,我想這可能有助於增加這個答案:

在.net中我使用Google.Apis.Calendar.v3遇到同樣的問題。我發現當我指定「OriginalStartDateTime」時,我的「復發」沒有被Google的API評估。

下面是我使用的代碼示例。

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;