When viewing upcoming events on the calendar, events that have more than one date / time assigned to them show an "other dates" notice listing the other dates for the event. I would like to have this same functionality for events that are assigned a single date/time but are configured as repeating events.
I looked in CalendarDateTime.php to locate the method that returns the values used in the default calendar template:
public function OtherDates()
{
if($this->Announcement())
return false;
if($this->Event()->Recursion == 1) {
return $this->Event()->Parent()->getNextRecurringEvents($this->Event(), $this);
}
return DataObject::get(
get_class($this),
"EventID = {$this->EventID} AND StartDate != '{$this->StartDate}'",
"StartDate ASC",
"",
$this->Event()->Calendar()->DefaultEventDisplay
);
}
The first chunk is clear: if it's an "announcement" don't return anything.
The third chunk also works: if this is not a "repeating event", retrieve any DateTime objects for this Event that do not have the same StartDate.
The second chunk is what puzzles me. It appears to me without digging deeper into the code that this would return something similar to the third chunk, but for repeating events. But that isn't what it returns. It returns an object that is not empty, but doesn't seem to have anything useful in it (no event information).
Can anyone explain what is supposed to happen for repeating events? Are they supposed to return "other dates" just like non-repeating events that have multiple dates/times manually configured? Or is it purposely returning something else?