I have been reading the docs and playing with different EventQuery parameters for days now. I am using C# .NET with google's .net api to get the events from a public calendar I set up. I can get the events from the api just fine but I can't get it to give me the next upcoming events by date. My calendar has mixed recurrence events with one-shot events. I have read stuff on the internet to use direct query parameter strings in the request uri but doesn't seem to work right when using it in the .net api structure. Here is what I have currently as my base:
CalendarService myService = new CalendarService("testGoogleCalendar-1");
EventQuery myQuery = new EventQuery();
myQuery.Uri = new Uri(CalendarURI);
myQuery.NumberToRetrieve = NumberOfEvents;
EventFeed calFeed = myService.Query(myQuery);
foreach (AtomEntry entry in calFeed.Entries)
{
LiteralControl test = new LiteralControl("<p><b>" + entry.Title.Text + "</b></p>");
this.Controls.Add(test);
}
I have tried playing with the EventQuery's members StartDate, StartTime, EndTime, SortOrder, FutureEvents and even tried adding "?orderby=starttime" to the CalendarURI local member.
The api query's seems to return the order of published date of the event which is when I created the event in the calendar not when the event is going to take place.
I have also been trying to get just the date and time of the event from the AtomEntry object so I can sort it myself and format it with the title in my control but the only place I see it is in AtomEntry's Content.Content which also has other stuff I don't really want. Is there a DateTime member to AtomEntry for this so I can just get the date?
This one has really got me confused right now so any help is appreciated.
Eric