public function DateRange::setEnd in Recurring Dates Field 3.x
Same name and namespace in other branches
- 8.2 src/DateRange.php \Drupal\date_recur\DateRange::setEnd()
- 3.0.x src/DateRange.php \Drupal\date_recur\DateRange::setEnd()
- 3.1.x src/DateRange.php \Drupal\date_recur\DateRange::setEnd()
Set the end date.
Parameters
\DateTimeInterface $end: The end date.
Return value
$this Return object for chaining.
Throws
\InvalidArgumentException When there is a problem with the start and/or end date.
File
- src/
DateRange.php, line 91
Class
- DateRange
- Defines a date range.
Namespace
Drupal\date_recurCode
public function setEnd(\DateTimeInterface $end) {
// Clone to ensure references are lost.
$this->end = clone $end;
$this
->validateDates();
return $this;
}