Explorar o código

Fix DateTimeType by adding missing default options

Michel Weimerskirch %!s(int64=14) %!d(string=hai) anos
pai
achega
87c609b4a4

+ 10 - 1
src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php

@@ -110,6 +110,15 @@ class DateTimeType extends AbstractType
             'time_pattern' => null,
             'time_widget' => null,
             'time_format' => null,
+            /* Defaults for date field */
+            'years' => range(date('Y') - 5, date('Y') + 5),
+            'months' => range(1, 12),
+            'days' => range(1, 31),
+            /* Defaults for time field */
+            'hours' => range(0, 23),
+            'minutes' => range(0, 59),
+            'seconds' => range(0, 59),
+            'with_seconds' => false,
         );
     }
 
@@ -117,4 +126,4 @@ class DateTimeType extends AbstractType
     {
         return 'datetime';
     }
-}
+}