Skip to content

Commit

Permalink
Dev: Fix error for validation of date and times from c8ee525.
Browse files Browse the repository at this point in the history
- Don't use `!` on the format method
  • Loading branch information
AllanJard committed Feb 25, 2019
1 parent 85a6501 commit 1da02ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Editor/Validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1da02ab

Please sign in to comment.