List of usage examples for com.google.gwt.gdata.client.calendar CalendarEventQuery setMinimumStartTime
public final native void setMinimumStartTime(DateTime minimumStartTime) ;
From source file:com.google.gwt.gdata.sample.hellogdata.client.CalendarQueryEventsByDateDemo.java
License:Apache License
/** * Retrieves an events feed using a Query object. * In GData, feed URIs can contain querystring parameters. The * GData query objects aid in building parameterized feed URIs. * Upon successfully receiving the events feed, the event entries * are displayed to the user via the showData method. * The MinimumStartTime and MaximumStartTime parameters are used to * limit the range of events to a given time period. * /* w w w .j a v a 2 s . com*/ * @param eventsFeedUri The uri of the events feed */ @SuppressWarnings("deprecation") private void queryEvents(String eventsFeedUri) { showStatus("Querying for events...", false); CalendarEventQuery query = CalendarEventQuery.newInstance(eventsFeedUri); Date startDate = new Date(); startDate.setMonth(startDate.getMonth() - 1); Date endDate = new Date(); query.setMinimumStartTime(DateTime.newInstance(startDate)); query.setMaximumStartTime(DateTime.newInstance(endDate)); service.getEventsFeed(query, new CalendarEventFeedCallback() { public void onFailure(CallErrorException caught) { showStatus("An error occurred while retrieving the Event feed: " + caught.getMessage(), true); } public void onSuccess(CalendarEventFeed result) { CalendarEventEntry[] entries = (CalendarEventEntry[]) result.getEntries(); if (entries.length == 0) { showStatus("No events found for the past month.", false); } else { showData(entries); } } }); }