/** * {@inheritdoc} */ public function matches(\DateTime $date) { if ('?' === $this->value) { return true; } $found = parent::matches($date); if (!$found) { $values = $this->getValueArray(); foreach ($values as $value) { if ($found) { break; } if (strpos($value, '#') !== false) { $found = $this->matchesHash($value, $date); } elseif (strpos($value, 'L') !== false) { $found = $this->matchesLastDay($value, $date); } } } return $found; }
/** * {@inheritdoc} */ public function matches(\DateTime $date) { if ('?' === $this->value) { return true; } $found = parent::matches($date); if (!$found) { $values = $this->getValueArray(); foreach ($values as $value) { if ($found) { break; } if ('L' === $value) { $found = $date->format('t') == $date->format('d'); } elseif (strpos($value, 'W') !== false) { $found = $this->matchesNearestWeekday($value, $date); } } } return $found; }