You are here

public function RollingInterval::calculateStart in Recurring Time Period 8

Calculates the end of the previous period.

Parameters

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

Return value

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

Overrides RecurringPeriodBase::calculateStart

File

src/Plugin/RecurringPeriod/RollingInterval.php, line 68

Class

RollingInterval
Provides a period based on a rolling interval from the start date.

Namespace

Drupal\recurring_period\Plugin\RecurringPeriod

Code

public function calculateStart(\DateTimeImmutable $date) {

  // For a rolling interval, the start date is the same as the given date.
  return $date;
}