我在寻找应该设置为基于年度的公共假期的查询参数

时间:2018-07-11 06:05:00

标签: c# google-api google-calendar-api

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 应该使用什么参数来获取上一年的日历事件?

0 个答案:

没有答案