// this sample currently only demonstrates publishing all-day events
// an event in Google Base must have a start-time and end-time, so
// this simulates that by adding 1 day to the end-date specified, if the
// start and end times are identical
DateTime startDateTime = new DateTime(event.getStartDate());
startDateTime.setDateOnly(true);
DateTime endDateTime = null;
if (event.getStartDate().equals(event.getEndDate())) {
Calendar endDateCal = new GregorianCalendar();
endDateCal.setTime(event.getEndDate());
endDateCal.add(Calendar.DATE, 1);
endDateTime = new DateTime(endDateCal.getTime());
} else {
endDateTime = new DateTime(event.getEndDate());
}
endDateTime.setDateOnly(true);
gbaseAttributes.addDateTimeRangeAttribute("event date range",
new DateTimeRange(startDateTime, endDateTime));
gbaseAttributes.addTextAttribute("event performer", "Google mashup test");