protected function filterDate($field, $details, $label, $message) {
        if (false != ($date = @strtotime($this->getValue($field)))) {
            if (isset($details['min']) && $date < $details['min']) {
                throw new \Exception($message ? $message : $this->translate("Date must be bigger than $details[min]!"));
            }
            if (isset($details['max']) && $date > $details['max']) {
                throw new \Exception($message ? $message : $this->translate("Date must be smaller than $details[min]!"));
            }

            if (isset($details['format'])) {
                $this->setValue($field, date($details['format'], $date));
            }

            return true;
        }
        throw new \Exception($message ? $message : $this->translate("{$this->getValue($field)} is not a date!"));
    }
protected function filterDate($field, $details, $label, $message) {
        if (false != ($date = @strtotime($this->getValue($field)))) {
            if (isset($details['min']) && $date < $details['min']) {
                throw new \Exception($message ? $message : $this->translate("Date must be bigger than $details[min]!"));
            }
            if (isset($details['max']) && $date > $details['max']) {
                throw new \Exception($message ? $message : $this->translate("Date must be smaller than $details[min]!"));
            }

            if (isset($details['format'])) {
                $this->setValue($field, date($details['format'], $date));
            }

            return true;
        }
        throw new \Exception($message ? $message : $this->translate("{$this->getValue($field)} is not a date!"));
    }
protected function filterDate ( $ field , $ details , $ label , $ message ) { if ( false != ( $ date = @ strtotime ( $ this -> getValue ( $ field ) ) ) ) { if ( isset ( $ details [ 'min' ] ) && $ date < $ details [ 'min' ] ) { throw new \ Exception ( $ message ? $ message : $ this -> translate ( "Date must be bigger than $details[min]!" ) ) ; } if ( isset ( $ details [ 'max' ] ) && $ date > $ details [ 'max' ] ) { throw new \ Exception ( $ message ? $ message : $ this -> translate ( "Date must be smaller than $details[min]!" ) ) ; } if ( isset ( $ details [ 'format' ] ) ) { $ this -> setValue ( $ field , date ( $ details [ 'format' ] , $ date ) ) ; } return true ; } throw new \ Exception ( $ message ? $ message : $ this -> translate ( "{$this->getValue($field)} is not a date!" ) ) ; }
Checks if value is date or time and if it fits in interval
@param string $field
@param string [string] $details
@param string $label
@param string $message
@return boolean
@throws \Exception
Checks if value is date or time and if it fits in interval