public function checkLocalizedDate($value, ExecutionContextInterface $context)
    {
        $format = LangQuery::create()->findOneByByDefault(true)->getDatetimeFormat();

        if (false === \DateTime::createFromFormat($format, $value)) {
            $context->addViolation(
                Translator::getInstance()->trans(
                    "Date '%date' is invalid, please enter a valid date using %fmt format",
                    [
                        '%fmt'  => $format,
                        '%date' => $value
                    ]
                )
            );
        }
    }
public function checkLocalizedDate($value, ExecutionContextInterface $context)
    {
        $format = LangQuery::create()->findOneByByDefault(true)->getDatetimeFormat();

        if (false === \DateTime::createFromFormat($format, $value)) {
            $context->addViolation(
                Translator::getInstance()->trans(
                    "Date '%date' is invalid, please enter a valid date using %fmt format",
                    [
                        '%fmt'  => $format,
                        '%date' => $value
                    ]
                )
            );
        }
    }
public function checkLocalizedDate ( $ value , ExecutionContextInterface $ context ) { $ format = LangQuery :: create ( ) -> findOneByByDefault ( true ) -> getDatetimeFormat ( ) ; if ( false === \ DateTime :: createFromFormat ( $ format , $ value ) ) { $ context -> addViolation ( Translator :: getInstance ( ) -> trans ( "Date '%date' is invalid, please enter a valid date using %fmt format" , [ '%fmt' => $ format , '%date' => $ value ] ) ) ; } }
Validate a date entered with the default Language date format.

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