src/Leevel/Validate/Date.php
public function validateDate($value, array $parameter, IValidator $validator, string $field, bool $before = false): bool
    {
        if (!is_string($value)) {
            return false;
        }

        if (!array_key_exists(0, $parameter)) {
            throw new InvalidArgumentException('Missing the first element of parameter.');
        }

        $this->validator = $validator;

        if ($format = $this->getDateFormat($field)) {
            return $this->doWithFormat($format, $value, $parameter, $before);
        }

        if (!($time = strtotime($parameter[0]))) {
            if (null === ($_ = $validator->getFieldValue($parameter[0]))) {
                return false;
            }

            return $this->compareTime(strtotime($value), strtotime($_), $before);
        }

        return $this->compareTime(strtotime($value), $time, $before);
    }
public function validateDate($value, array $parameter, IValidator $validator, string $field, bool $before = false): bool
    {
        if (!is_string($value)) {
            return false;
        }

        if (!array_key_exists(0, $parameter)) {
            throw new InvalidArgumentException('Missing the first element of parameter.');
        }

        $this->validator = $validator;

        if ($format = $this->getDateFormat($field)) {
            return $this->doWithFormat($format, $value, $parameter, $before);
        }

        if (!($time = strtotime($parameter[0]))) {
            if (null === ($_ = $validator->getFieldValue($parameter[0]))) {
                return false;
            }

            return $this->compareTime(strtotime($value), strtotime($_), $before);
        }

        return $this->compareTime(strtotime($value), $time, $before);
    }
校验日期.

@param mixed                       $value
@param array                       $parameter
@param \Leevel\Validate\IValidator $validator
@param string                      $field
@param bool                        $before

@return bool