You are here

public function DateRange::__construct in Recurring Dates Field 3.0.x

Same name and namespace in other branches
  1. 8.2 src/DateRange.php \Drupal\date_recur\DateRange::__construct()
  2. 3.x src/DateRange.php \Drupal\date_recur\DateRange::__construct()
  3. 3.1.x src/DateRange.php \Drupal\date_recur\DateRange::__construct()

Creates a new DateRange.

Parameters

\DateTimeInterface $start: The start date.

\DateTimeInterface $end: The end date.

File

src/DateRange.php, line 34

Class

DateRange
Defines a date range.

Namespace

Drupal\date_recur

Code

public function __construct(\DateTimeInterface $start, \DateTimeInterface $end) {
  $this->start = clone $start;
  $this->end = clone $end;
  $this
    ->validateDates();
}