|
@@ -32,7 +32,7 @@ class DateType extends AbstractType
|
|
|
);
|
|
|
|
|
|
if ($options['widget'] === 'text') {
|
|
|
- $builder->setClientTransformer(new DateTimeToLocalizedStringTransformer($options['user_timezone'], $options['data_timezone'], $options['format'], \IntlDateFormatter::NONE));
|
|
|
+ $builder->setClientTransformer(new DateTimeToLocalizedStringTransformer($options['data_timezone'], $options['user_timezone'], $options['format'], \IntlDateFormatter::NONE));
|
|
|
} else {
|
|
|
// Only pass a subset of the options to children
|
|
|
$yearOptions = array(
|
|
@@ -54,13 +54,13 @@ class DateType extends AbstractType
|
|
|
$builder->add('year', 'choice', $yearOptions)
|
|
|
->add('month', 'choice', $monthOptions)
|
|
|
->add('day', 'choice', $dayOptions)
|
|
|
- ->setClientTransformer(new DateTimeToArrayTransformer($options['user_timezone'], $options['data_timezone'], array('year', 'month', 'day')))
|
|
|
+ ->setClientTransformer(new DateTimeToArrayTransformer($options['data_timezone'], $options['user_timezone'], array('year', 'month', 'day')))
|
|
|
->addRendererPlugin(new DatePatternPlugin($formatter));
|
|
|
}
|
|
|
|
|
|
if ($options['input'] === 'string') {
|
|
|
$builder->setNormTransformer(new ReversedTransformer(
|
|
|
- new DateTimeToStringTransformer($options['data_timezone'], 'Y-m-d', $options['data_timezone'])
|
|
|
+ new DateTimeToStringTransformer($options['data_timezone'], $options['data_timezone'], 'Y-m-d')
|
|
|
));
|
|
|
} else if ($options['input'] === 'timestamp') {
|
|
|
$builder->setNormTransformer(new ReversedTransformer(
|
|
@@ -86,8 +86,8 @@ class DateType extends AbstractType
|
|
|
'input' => 'datetime',
|
|
|
'pattern' => null,
|
|
|
'format' => \IntlDateFormatter::MEDIUM,
|
|
|
- 'data_timezone' => date_default_timezone_get(),
|
|
|
- 'user_timezone' => date_default_timezone_get(),
|
|
|
+ 'data_timezone' => null,
|
|
|
+ 'user_timezone' => null,
|
|
|
'csrf_protection' => false,
|
|
|
// Don't modify \DateTime classes by reference, we treat
|
|
|
// them like immutable value objects
|