I read documents and played with various EventQuery parameters for several days. I am using C # .NET with google.net api to get events from the public calendar that I configured. I can get events from the api just fine, but I can not get it to give me the next upcoming events by date. Ambiguous events with one-time events occur on my calendar. I read material on the Internet to use direct query parameter strings in uri request, but it doesn't seem to work correctly when using it in a .net api structure. Here is what I currently have 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 tried to play with EventQuery members StartDate, StartTime, EndTime, SortOrder, FutureEvents and even tried to add "? Orderby = starttime" to the local CalendarURI element.
It seems that the api request returns the order of the published date of the event when I created the event on the calendar when the event does not happen.
I am also trying to get only the date and time of the event from the AtomEntry object so that I can sort it myself and format it with a title in my control, but the only place I see in AtomEntry is Content.Content which also has other things that I really I do not want. Is there a DateTime member for AtomEntry for this, so I can just get the date?
It really pissed me off right now, so any help is appreciated.
Eric