Skip to content

Commit

Permalink
Fix error in validation of datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
1blankz7 committed Mar 4, 2022
1 parent 3fbf583 commit 8299ee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Type/DatetimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ private function isValidDatetime(string $value): bool
$date = DateTime::createFromFormat($this->datetimeFormat, $value, new DateTimeZone($this->datetimeZone));
$errors = DateTime::getLastErrors();

return $date && !$errors;
return $date && (!$errors || $errors['warning_count'] === 0 && $errors['error_count'] === 0);
}
}

0 comments on commit 8299ee8

Please sign in to comment.