You are here

public function FixedReferenceDateInterval::calculateEnd in Recurring Time Period 8

Calculates the end date and time for the period.

Parameters

\DateTimeImmutable $start: The date and time to begin the period from.

Return value

\DateTimeImmutable|int The expiry date and time, or RecurringPeriodInterface::UNLIMITED.

Overrides RecurringPeriodBase::calculateEnd

1 call to FixedReferenceDateInterval::calculateEnd()
FixedReferenceDateInterval::calculateDate in src/Plugin/RecurringPeriod/FixedReferenceDateInterval.php
Calculates the end date and time for the period.

File

src/Plugin/RecurringPeriod/FixedReferenceDateInterval.php, line 118

Class

FixedReferenceDateInterval
Provides a fixed date period.

Namespace

Drupal\recurring_period\Plugin\RecurringPeriod

Code

public function calculateEnd(\DateTimeImmutable $start) {
  $config = $this
    ->getConfiguration();
  $date_interval = $this
    ->getDateInterval();
  return $this
    ->findNextAppropriateDate($start, $config['reference_date'], $date_interval);
}