Parcourir la source

Merge pull request #2136 from Bladrak/dateFormType

Fix form_type option in date filter types
Thomas il y a 11 ans
Parent
commit
bef55a9608

+ 1 - 1
Form/Type/Filter/DateRangeType.php

@@ -52,7 +52,7 @@ class DateRangeType extends AbstractType
 
         $builder
             ->add('type', 'choice', array('choices' => $choices, 'required' => false))
-            ->add('value', 'sonata_type_date_range', array('field_options' => $options['field_options']))
+            ->add('value', $options['field_type'], array('field_options' => $options['field_options']))
         ;
     }
 

+ 1 - 1
Form/Type/Filter/DateTimeRangeType.php

@@ -52,7 +52,7 @@ class DateTimeRangeType extends AbstractType
 
         $builder
             ->add('type', 'choice', array('choices' => $choices, 'required' => false))
-            ->add('value', 'sonata_type_datetime_range', array('field_options' => $options['field_options']))
+            ->add('value', $options['field_type'], array('field_options' => $options['field_options']))
         ;
     }
 

+ 1 - 1
Form/Type/Filter/DateTimeType.php

@@ -68,7 +68,7 @@ class DateTimeType extends AbstractType
 
         $builder
             ->add('type', 'choice', array('choices' => $choices, 'required' => false))
-            ->add('value', 'datetime', array_merge(array('required' => false), $options['field_options']))
+            ->add('value', $options['field_type'], array_merge(array('required' => false), $options['field_options']))
         ;
     }
 

+ 1 - 1
Form/Type/Filter/DateType.php

@@ -68,7 +68,7 @@ class DateType extends AbstractType
 
         $builder
             ->add('type', 'choice', array('choices' => $choices, 'required' => false))
-            ->add('value', 'date', array_merge(array('required' => false), $options['field_options']))
+            ->add('value', $options['field_type'], array_merge(array('required' => false), $options['field_options']))
         ;
     }