Hello Basia,
Yes, you can get a feed ordered by the date of the event.
The relevant query parameters are:
orderby - can be 'starttime' or 'lastmodified' and defaults to be
'lastmodified'
sortorder - can be 'ascending' or 'descending'
It doesn't look like these params are in the Java Client Library,
however. So, you can use the Query.setStringCustomParameter(name,
value) method to set them.
As an example, the following should work:
myQuery.setStringCustomParameter("orderby", "starttime");
The following documents the available query parameters:
http://code.google.com/apis/calendar/reference.html#Parameters
If you're just trying to display events, you might also want to look
at the singleevents query param.
I've filed a bug to enable support in the Java client library for the
query parameters documented above.
Thanks and good luck!
-Ryan
On May 3, 10:02 am, Basia <[EMAIL PROTECTED]> wrote:
> I was wondering if there is a way to get the resultFeed from
> GoogleCalendar sorted by date ]....meaning when i have three events in
> the calendar and I want to display them using result
> (CalendarEventEntry)resultFeed.getEntries().get(i) where i is the
> number from 0 to number of events....the result of the events seems to
> be printed in the order they were added? I was wondering if there is a
> way to go through the resultFeed by date instead of me have to sort it
> myself:
>
> Here is a the code:
>
> CalendarQuery myQuery = new
> CalendarQuery(privateFeedUrl);
> myQuery.setMinimumStartTime(info.getStartDate());
> myQuery.setMaximumStartTime(info.getEndDate());
>
> CalendarEventFeed resultFeed =
> calendarService.query(myQuery,
> CalendarEventFeed.class);
> return resultFeed;
>
> for (int i=0; i< resultFeed.getEntries().size(); i++)
> CalendarEventEntry calEntry =
> (CalendarEventEntry)resultFeed.getEntries().get(i);
> //print calEntry
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---