public function IntervalItemInterface::applyInterval in Interval Field 8
Applies an interval to a date object.
Parameters
\DateTime $date: A DateTime object to which the interval needs to be applied
bool $limit: When calling the interval apply function with months or a month multiplier, keep the date in the last day of the month if this was exceeded. Example, with $limit set to TRUE, January 31st +1 month will result in February 28th.
Throws
\Drupal\interval\InvalidIntervalException
1 method overrides IntervalItemInterface::applyInterval()
- IntervalItem::applyInterval in src/
Plugin/ Field/ FieldType/ IntervalItem.php - Applies an interval to a date object.
File
- src/
IntervalItemInterface.php, line 44
Class
Namespace
Drupal\intervalCode
public function applyInterval(\DateTime $date, $limit = FALSE);