/** * It will if check if given date is European * * @param strig $value Date string * @param null|mixed $context * @return bool */ public function isValid($value, $context = null) { if ((trim($value) == "" || trim($value) == "--") && $this->getIgnoreEmpty()) { return true; } $ts = OSS_Date::getTimestamp($value, $this->_dateFormat); if ($ts === false) { $this->_error(self::INVALID_DATE); return false; } $dparts = OSS_Date::dateSplit($value, $this->_dateFormat); $value = sprintf("%02d/%02d/%d", $dparts[0], $dparts[1], $dparts[2]); if ($value != date("d/m/Y", mktime(0, 0, 0, $dparts[1], $dparts[0], $dparts[2]))) { $this->_error(self::INVALID_DATE); return false; } return true; }