public Events GetCalendar(string calendarID, int year)
{
EventsResource.ListRequest request = service.Events.List(calendarID);
request.TimeMin = new DateTime(year, 1, 1);
request.TimeMax = new DateTime(year, 12, 31);
request.ShowDeleted = false;
request.SingleEvents = true;
request.OrderBy = EventsResource.ListRequest.OrderByEnum.StartTime;
// List events.
Events events = request.Execute();
if (events.Items.Count > 0)
return events;
else
return null;
}
输入(主要,2015年)==>输出:null 应该使用什么参数来获取上一年的日历事件?