[英].NET Google calendar api v3 recurrence not working
我最近注意到,使用.NET的重復發生已停止工作(不確定是否已在其他語言庫中停止工作)。
該代碼可以正常運行一年以上,但是突然之間,它不能保存重復發生,可以保存事件,但是作為單個實例,這是一段使用OAuth2的代碼,非常簡單(重復發生的規則是在Google內部創建的事件,因此不會有任何錯誤),此代碼將保存事件而不會重復發生:
Google.Apis.Calendar.v3.Data.Event entry = new Google.Apis.Calendar.v3.Data.Event();
string recurrenceRule = "RRULE:FREQ=DAILY;UNTIL=20130906T222536Z";
entry.Summary = "Test RO2";
entry.Description = "from prototype2";
entry.Location = "Home2";
// Dummy start and end datetime, timezone GMT -4 (my timezone)
string startTime = String.Format("{0:s}", DateTime.Now);
string endTime = String.Format("{0:s}", DateTime.Now.AddMinutes(30));
EventDateTime starting = new EventDateTime() {
DateTime = startTime,
TimeZone = "America/La_Paz"
};
EventDateTime ending = new EventDateTime()
{
DateTime = endTime,
TimeZone = "America/La_Paz"
};
entry.Start = starting;
entry.End = ending;
entry.Recurrence = new List<string>(){
recurrenceRule
};
entry.OriginalStartTime = starting;
// The event is saved, but it returns with no recurrence and no exception
Google.Apis.Calendar.v3.Data.Event eventCreated = _service.Events.Insert(entry, calendarId).Fetch();
如果有人知道修復程序或解決方法,以及其他庫(PHP,Ruby,Python,Java等)是否存在相同問題,請告訴我
發生此行:
entry.OriginalStartTime = starting;
搞砸了所有重復發生,刪除了該行即可解決問題,不知道為什么,由於缺少支持,過時的GUI和無用的示例,Google API幾乎是一個黑洞。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.