You are here

public function Interval::ceil in Commerce Core 8.2

Increases the date to the upper boundary.

For example, an Apr 14th date would be increased to May 1st for a 1 month interval, and to June 1st for a 2 month interval.

Parameters

\Drupal\Core\Datetime\DrupalDateTime $date: The date.

Return value

\Drupal\Core\Datetime\DrupalDateTime The new date.

File

src/Interval.php, line 184

Class

Interval
Provides a value object for intervals (1 month, 14 days, etc).

Namespace

Drupal\commerce

Code

public function ceil(DrupalDateTime $date) : DrupalDateTime {
  return $this
    ->add($this
    ->floor($date));
}