You are here

public function RlHelper::current in Recurring Dates Field 3.x

Same name and namespace in other branches
  1. 8.2 src/Rl/RlHelper.php \Drupal\date_recur\Rl\RlHelper::current()
  2. 3.0.x src/Rl/RlHelper.php \Drupal\date_recur\Rl\RlHelper::current()
  3. 3.1.x src/Rl/RlHelper.php \Drupal\date_recur\Rl\RlHelper::current()

File

src/Rl/RlHelper.php, line 217

Class

RlHelper
Helper for recurring rules implemented with rlanvin/rrule.

Namespace

Drupal\date_recur\Rl

Code

public function current() : DateRange {
  $occurrenceStart = $this->set
    ->current();
  $occurrenceEnd = clone $occurrenceStart;
  $occurrenceEnd
    ->add($this->recurDiff);
  return new DateRange($occurrenceStart, $occurrenceEnd);
}