You are here

public function RecurringPeriodBase::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 RecurringPeriodInterface::calculateEnd

3 methods override RecurringPeriodBase::calculateEnd()
FixedReferenceDateInterval::calculateEnd in src/Plugin/RecurringPeriod/FixedReferenceDateInterval.php
Calculates the end date and time for the period.
RollingInterval::calculateEnd in src/Plugin/RecurringPeriod/RollingInterval.php
Calculates the end date and time for the period.
Unlimited::calculateEnd in src/Plugin/RecurringPeriod/Unlimited.php
Calculates the end date and time for the period.

File

src/Plugin/RecurringPeriod/RecurringPeriodBase.php, line 134

Class

RecurringPeriodBase
Base class for recurring period plugins.

Namespace

Drupal\recurring_period\Plugin\RecurringPeriod

Code

public function calculateEnd(\DateTimeImmutable $start) {

  // Call the deprecated method in the plugin class.
  // TODO: reverse this, so we implement the deprecated method.
  return $this
    ->calculateDate($start);
}