diff --git a/Editor/Validate.php b/Editor/Validate.php index 7d9311c..ced5a1c 100644 --- a/Editor/Validate.php +++ b/Editor/Validate.php @@ -903,12 +903,12 @@ public static function dateFormat( $format, $cfg=null ) { $common; } - if ( substr($format, 0, 1) !== '!' ) { - $format = '!'.$format; - } + $formatCreate = substr($format, 0, 1) !== '!' ? + '!'.$format : + $format; + + $date = \DateTime::createFromFormat( $formatCreate, $val ); - $date = \DateTime::createFromFormat( $format, $val) ; - return $date && $date->format( $format ) == $val ? true : $opts->message();