Search code examples
google-calendar-apigdata-api

What does gdata-java-api's CalendarEventEntry.getTimes() return?


I've been looking up and down the api-docs and couldn't find out if and when the method returns more than one When instance. The code seems to parse repeating occurrences of <gd:when> elements, the common elements section of the protocol description has a * after the gd:when property, indicating that there can be multiple elements of this type. But the description implies that there is only one event element.

So in which case does CalendarEventEntry.getTimes() return more than one When instance? It seems to be possible to add multiple instances via addTime(), but can you do it via the default web interface?


Solution

  • The answer can be found in Data API Developer's Guide: The Protocol: Section "Creating Recurring Events":


    • No query parameters: a recurring event is returned as a single element or object, with a recurrence child element or property. No when elements or properties are included in the recurring event.
    • start-min and/or start-max specified: a recurring event is represented as a single element or object, with multiple when elements or objects for each occurrence in the range specified. A recurrence is also included.
    • singleevents=true: recurring events are represented in the same format as single events, with a single element or object per occurrence of the event. Each event includes a single when element or object, but does not include the recurrence syntax. It does, however, include an originalEvent element or property.