-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Fixed few issues with Date and Time #1485
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
Conversation
* TimeType: - seconds are no longer populated if "with_seconds" = false - "widget = text" is now properly rendered (closes symfony#1480) * DateTimeToStringTransformer: - fixed using not default "format" (probably fix symfony#1183) * DateType, DateTimeType, TimeType: - fixed "input = datetime" and test covered - a bit changed readability
@@ -101,15 +109,26 @@ class DateTimeType extends AbstractType | |||
|
|||
if ($options['input'] === 'string') { | |||
$builder->appendNormTransformer(new ReversedTransformer( | |||
new DateTimeToStringTransformer($options['data_timezone'], $options['data_timezone'], $format) | |||
new DateTimeToStringTransformer( | |||
$options['data_timezone'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert this kind of changes? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this make code a bit more readable, but reverted it ;-)
$dateTime = new \DateTime($value, new \DateTimeZone($this->outputTimezone)); | ||
|
||
// Force value to be in same format as given to transform | ||
if ($value !== $dateTime->format($this->format)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this piece of code. What are you trying to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commits ------- 3917ed7 Revert "* DateType, DateTimeType, TimeType: - a bit changed readability" c85b815 Fixed few issues with Date and Time: Discussion ---------- [Form] Fixed few issues with Date and Time Fixed few issues with Date and Time: * TimeType: - seconds are no longer populated if "with_seconds" = false - "widget = text" is now properly rendered (closes #1480) * DateTimeToStringTransformer: - fixed using not default "format" (probably fix #1183) * DateType, DateTimeType, TimeType: - fixed "input = datetime" and test covered
Fixed few issues with Date and Time: