浏览代码

Merge pull request #2136 from Bladrak/dateFormType

Fix form_type option in date filter types
Thomas 11 年之前
父节点
当前提交
bef55a9608

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

@@ -52,7 +52,7 @@ class DateRangeType extends AbstractType
 
 
         $builder
         $builder
             ->add('type', 'choice', array('choices' => $choices, 'required' => false))
             ->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
         $builder
             ->add('type', 'choice', array('choices' => $choices, 'required' => false))
             ->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
         $builder
             ->add('type', 'choice', array('choices' => $choices, 'required' => false))
             ->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
         $builder
             ->add('type', 'choice', array('choices' => $choices, 'required' => false))
             ->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']))
         ;
         ;
     }
     }