You are here

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

1 call to RecurringPeriodBase::calculateStart()
RecurringPeriodBase::getPeriodContainingDate in src/Plugin/RecurringPeriod/RecurringPeriodBase.php
Gets a period object that contains the given date.
3 methods override RecurringPeriodBase::calculateStart()
FixedReferenceDateInterval::calculateStart in src/Plugin/RecurringPeriod/FixedReferenceDateInterval.php
Calculates the end of the previous period.
RollingInterval::calculateStart in src/Plugin/RecurringPeriod/RollingInterval.php
Calculates the end of the previous period.
Unlimited::calculateStart in src/Plugin/RecurringPeriod/Unlimited.php
Calculates the end of the previous period.

File

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

Class

RecurringPeriodBase
Base class for recurring period plugins.

Namespace

Drupal\recurring_period\Plugin\RecurringPeriod

Code

public function calculateStart(\DateTimeImmutable $date) {
  return $date;
}