On Wed, Sep 17, 2008 at 3:36 AM, formal <[EMAIL PROTECTED]> wrote:
>
> Hi Trevor,
>
> I'm using the JAVA API. Here is a brief outline of the code:
>
>
> CalendarEventEntry entry = ...;
>
> entry.setTitle(new PlainTextConstruct(_TITLE_PREFIX + " * " + ...);
>
> if (practical.type() == Practical.MARKED) {
> entry.setContent(new PlainTextConstruct("This is a marked
> practical!"));
> }
>
> entry.setQuickAdd(false);
>
> {
> DateTime startTime = ...;
> DateTime endTime = ...;
>
> When eventTimes = new When();
> eventTimes.setStartTime(startTime);
> eventTimes.setEndTime(endTime);
> entry.addTime(eventTimes);
> }
>
> URL editUrl = new URL(entry.getEditLink().getHref());
> ... = _service.update(editUrl, entry);
>
> I have created a new When object but can only add it to the entry and
> not replace the existing time.
>
> Regards,
> David
Hi David.
The BaseEventEntry.addTime(When Time) method just runs:
getRepeatingExtension(When.class).add(time);
In a similar fashion, you should be able to replace a time entry by
calling something along the lines of:
entry.removeRepeatingExtension(entry.getRepeatingExtension(When.class));
entry.addRepeatingExtension(eventTimes);
I haven't tested this myself, so let me know if you run into any problems.
--
Trevor Johns
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---