Hi,

I would like to update the endTime of an existing CalendarEventEntry
(with java api) collected from a Calendar feed.

Eg. event has Nov 2nd as starttime end Nov 8th as endtime.
I would like to update the endTime to Nov 9th.

This is the code
---
CalendarEventFeed myResultsFeed = myService.getFeed(feedUrl,
CalendarEventFeed.class);
CalendarEventEntry entry = (CalendarEventEntry)
myResultsFeed.getEntries().get(0);

// get the event times
List<When> when = entry.getTimes();
When event = when.get(0);
DateTime endTime = event.getEndTime();

// setup the Calendar to perform a calculation on the given date
java.util.Calendar newEndTimeCalendar = java.util.Calendar.getInstance
();
newEndTimeCalendar.setTime(new Date(endTime.getValue()));

// just 'calculate' the next day
newEndTimeCalendar.add(Calendar.DAY_OF_MONTH, 1);

// update the event information with the new calculated endTime
event.setEndTime(new DateTime(newEndTimeCalendar.getTime()));

// perform the update
URL editUrl = new URL(entry.getEditLink().getHref());
CalendarEventEntry updatedEntry = (CalendarEventEntry) myService.update
(editUrl, entry);
---

On calling the myService.Update(...), an IllegalStateException is
thrown.

Any ideas on how to accomplish the update?
(fyi the dev guide is only illustrating an update of the event's
title)

Thanks in advance.
Olivier.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to