interval['unity']) { case DateUnity::NONE: $preCheck[] = 'Y'; case DateUnity::YEAR: $preCheck[] = 'n'; case DateUnity::MONTH: $preCheck[] = 'j'; case DateUnity::DAY: $preCheck[] = 'G'; case DateUnity::HOUR: $preCheck[] = 'i'; } $preCheck = implode(':', $preCheck); if ($checkDate->format($preCheck) !== $this->startDate->format($preCheck)) return false; if ($this->interval['unity'] == DateUnity::NONE) return true; if ($this->interval['unity'] == DateUnity::MINUTE) { $start = $this->startDate->format('U') / 60; $check = $checkDate->format('U') / 60; return (((($check - $start) % $this->interval['value']) === 0) && ($check >= $start)); } if ($this->interval['unity'] == DateUnity::HOUR) { $start = $this->startDate->format('U') / 3600; $check = $checkDate->format('U') / 3600; return (((($check - $start) % $this->interval['value']) === 0) && ($check >= $start)); } if ($this->interval['unity'] == DateUnity::DAY) { $start = $this->startDate->format('U') / 86400; $check = $checkDate->format('U') / 86400; return (((($check - $start) % $this->interval['value']) === 0) && ($check >= $start)); } if ($this->interval['unity'] == DateUnity::MONTH) { $start = ($this->startDate->format('Y') * 12) + $this->startDate->format('n'); $check = ($checkDate->format('Y') * 12) + $checkDate->format('n'); return (((($check - $start) % $this->interval['value']) === 0) && ($check >= $start)); } if ($this->interval['unity'] == DateUnity::YEAR) { $start = $this->startDate->format('Y'); $check = $checkDate->format('Y'); return (((($check - $start) % $this->interval['value']) === 0) && ($check >= $start)); } return false; } } ?>