You are here

public function RlHelper::getExcluded in Recurring Dates Field 8.2

Same name and namespace in other branches
  1. 3.x src/Rl/RlHelper.php \Drupal\date_recur\Rl\RlHelper::getExcluded()
  2. 3.0.x src/Rl/RlHelper.php \Drupal\date_recur\Rl\RlHelper::getExcluded()
  3. 3.1.x src/Rl/RlHelper.php \Drupal\date_recur\Rl\RlHelper::getExcluded()

Get excluded dates.

Excluded dates are intended to match the start date of occurrences. Excluded dates may not necessarily intersect with occurrences. Excluded dates in the same time zone as the initial dates.

Implementors of this method are responsible for ensuring time zone is normalised.

Return value

\DateTimeInterface[] An array of excluded dates.

Overrides DateRecurHelperInterface::getExcluded

File

src/Rl/RlHelper.php, line 206

Class

RlHelper
Helper for recurring rules implemented with rlanvin/rrule.

Namespace

Drupal\date_recur\Rl

Code

public function getExcluded() : array {

  // Implementation normally returns the same time zone as the EXDATE from the
  // rule string, normalise it here.
  return array_map(function (\DateTime $date) : \DateTime {
    return $date
      ->setTimezone($this->timeZone);
  }, $this->set
    ->getExDates());
}