8000 Remove value conversion to DateTime in ConstraintValidator by norkunas · Pull Request #34961 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Remove value conversion to DateTime in ConstraintValidator #34961

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove value conversion to DateTime in ConstraintValidator
  • Loading branch information
norkunas committed Dec 13, 2019
commit 85a8f0aa84db788282fbdfdd446376a268e571e4
6 changes: 0 additions & 6 deletions src/Symfony/Component/Validator/ConstraintValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ protected function formatValue($value, int $format = 0)
$locale = \Locale::getDefault();
$formatter = new \IntlDateFormatter($locale, \IntlDateFormatter::MEDIUM, \IntlDateFormatter::SHORT, $value->getTimezone());

// neither the native nor the stub IntlDateFormatter support
// DateTimeImmutable as of yet
if (!$value instanceof \DateTime) {
$value = new \DateTime($value->format('Y-m-d H:i:s.u e'));
}

return $formatter->format($value);
}

Expand Down
0