通过 Google Calendar API 避免使用 EventQuery 重叠事件
也许答案很简单,但我没有找到任何指向正确方向的提示:
EventQuery calQuery = new EventQuery(_calendarFeedString);
calQuery.StartTime = sDate.Date;
calQuery.EndTime = sDate.AddDays(1); //(EndTime is exclusive calling Google Feeds)
// Google EventQuery together with StartTime and EndTime returns also Events overlapping!
EventFeed myEvents = _calendarService.Query(calQuery);
此代码应该仅返回指定日期(sDate)的事件。但是,根据设计,Google 日历还会返回与该日期重叠的事件。因此,如果我有一个事件在前一天午夜之前开始并在第二天结束,它将在此查询中返回,因为它是重叠的。如何避免/防止此类查询中的重叠事件?我没有在 Google API 或其他来源中找到任何提示。
Maybe the answer is simple, but I have not found any hint pointing in the right direction:
EventQuery calQuery = new EventQuery(_calendarFeedString);
calQuery.StartTime = sDate.Date;
calQuery.EndTime = sDate.AddDays(1); //(EndTime is exclusive calling Google Feeds)
// Google EventQuery together with StartTime and EndTime returns also Events overlapping!
EventFeed myEvents = _calendarService.Query(calQuery);
This code should return events only of specified date (sDate). However as per design Google Calendar returns also events overlapping into this date. So if I have an event starting just before midnight the day before and ending the next day it will be returned in this query, as it is overlapping. How can I avoid/prevent overlapping events in such a query? I have not found any hint in Google API nor in other sources.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论