public function checkDate($value, ExecutionContextInterface $context)
    {
        $format = self::PHP_DATE_FORMAT;

        if (! empty($value) && false === \DateTime::createFromFormat($format, $value)) {
            $context->addViolation(Translator::getInstance()->trans("Date '%date' is invalid, please enter a valid date using %fmt format", [
                        '%fmt' => self::MOMENT_JS_DATE_FORMAT,
                        '%date' => $value
                    ]));
        }
    }
public function checkDate($value, ExecutionContextInterface $context)
    {
        $format = self::PHP_DATE_FORMAT;

        if (! empty($value) && false === \DateTime::createFromFormat($format, $value)) {
            $context->addViolation(Translator::getInstance()->trans("Date '%date' is invalid, please enter a valid date using %fmt format", [
                        '%fmt' => self::MOMENT_JS_DATE_FORMAT,
                        '%date' => $value
                    ]));
        }
    }
public function checkDate ( $ value , ExecutionContextInterface $ context ) { $ format = self :: PHP_DATE_FORMAT ; if ( ! empty ( $ value ) && false === \ DateTime :: createFromFormat ( $ format , $ value ) ) { $ context -> addViolation ( Translator :: getInstance ( ) -> trans ( "Date '%date' is invalid, please enter a valid date using %fmt format" , [ '%fmt' => self :: MOMENT_JS_DATE_FORMAT , '%date' => $ value ] ) ) ; } }
Validate a date entered with the current edition Language date format.

@param string                    $value
@param ExecutionContextInterface $context
Validate a date entered with the current edition Language date format .