繁体   English   中英

.NET Google Calendar API V3重复不起作用

[英].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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM