You are here

public function RecurringPeriodBase::getNextPeriod in Recurring Time Period 8

Calculates the period after the given period.

Parameters

\Drupal\recurring_period\Datetime\Period $period: The date and time to begin the period from.

Return value

\Drupal\recurring_period\Datetime\Period The period value object.

Overrides RecurringPeriodInterface::getNextPeriod

File

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

Class

RecurringPeriodBase
Base class for recurring period plugins.

Namespace

Drupal\recurring_period\Plugin\RecurringPeriod

Code

public function getNextPeriod(Period $period) {
  $end_date = $period
    ->getEndDate();
  return $this
    ->getPeriodFromDate($end_date);
}