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

    $format = $this->getArgValue('format');
    $date = \DateTime::createFromFormat($format, $value);
    $res = $date && $date->format($format) == $value;

    if (!$res) {
      $eMsg = Translation::get('validatorerror_isdate');
      $eMsg = str_replace('%format%', parent::getArgValue('format'), $eMsg);
      parent::addError($eMsg);
    }
    return $res;
  }
public function isValid($value)
  {
    parent::resetErrors();
    if (empty($value)) {
      return true;
    }

    $format = $this->getArgValue('format');
    $date = \DateTime::createFromFormat($format, $value);
    $res = $date && $date->format($format) == $value;

    if (!$res) {
      $eMsg = Translation::get('validatorerror_isdate');
      $eMsg = str_replace('%format%', parent::getArgValue('format'), $eMsg);
      parent::addError($eMsg);
    }
    return $res;
  }
Teste la validité

@param mixed $value Valeur à tester
@return boolean