You are here

protected function DateRRuleCalc::isValid in Date 8

Basic validation for an RRULE we can do something with.

2 calls to DateRRuleCalc::isValid()
DateRRuleCalc::compute in date_repeat/lib/Drupal/date_repeat/DateRRuleCalc.php
DateRRuleCalc::__construct in date_repeat/lib/Drupal/date_repeat/DateRRuleCalc.php
Compute dates that match the requested rule, within a specified date range.

File

date_repeat/lib/Drupal/date_repeat/DateRRuleCalc.php, line 192
Code to compute the dates that match an iCal RRULE.

Class

DateRRuleCalc

Namespace

Drupal\date_repeat

Code

protected function isValid() {

  // We alwqys need a start date.
  if (!$this->start_date instanceof \DateTime) {
    return FALSE;
  }

  // The only valid option for an empty end date is when we have a count.
  if (!$this->end_date instanceof \DateTime && empty($this->rrule['COUNT'])) {
    return FALSE;
  }
  return TRUE;
}