src/Form/Validators/IsDateInferior.php
public function isValid($value)
  {
    parent::resetErrors();
    if (empty($value)) {
      return true;
    }

    $format = $this->getArgValue('format');
    $dValidator = new Isdate(array('format' => $format));
    if (!$dValidator->isValid($value)) {
      $eMsg = Translation::get('validatorerror_isdateinferior');
      $eMsg = str_replace('%date%', parent::getArgValue('date'), $eMsg);
      parent::addError($eMsg);
      return false;
    } else {
      $date      = \DateTime::createFromFormat($format, $value)->format('U');
      $reference = \DateTime::createFromFormat($format, $this->getArgValue('date'))->format('U');
      if ($date >= $reference) {
        $eMsg = Translation::get('validatorerror_isdateinferior');
        $eMsg = str_replace('%date%', parent::getArgValue('date'), $eMsg);
        parent::addError($eMsg);
        return false;
      }
    }

    return true;
  }
public function isValid($value)
  {
    parent::resetErrors();
    if (empty($value)) {
      return true;
    }

    $format = $this->getArgValue('format');
    $dValidator = new Isdate(array('format' => $format));
    if (!$dValidator->isValid($value)) {
      $eMsg = Translation::get('validatorerror_isdateinferior');
      $eMsg = str_replace('%date%', parent::getArgValue('date'), $eMsg);
      parent::addError($eMsg);
      return false;
    } else {
      $date      = \DateTime::createFromFormat($format, $value)->format('U');
      $reference = \DateTime::createFromFormat($format, $this->getArgValue('date'))->format('U');
      if ($date >= $reference) {
        $eMsg = Translation::get('validatorerror_isdateinferior');
        $eMsg = str_replace('%date%', parent::getArgValue('date'), $eMsg);
        parent::addError($eMsg);
        return false;
      }
    }

    return true;
  }
Teste la validité

@param mixed $value Valeur à tester
@return boolean