jordillonch / CrudGeneratorBundle

This Symfony2 bundle aims to be the bundle that you are looking for create a nice CRUD with pagination, filter, translation and Twitter bootstrap 2.2.2 features.
MIT License
83 stars 36 forks source link

Unable to change the year range on a "Date" dropdown auto-generated #23

Closed jaznow closed 10 years ago

jaznow commented 10 years ago

I've been unable to find the way of changing the year range, by default its 5 years before today, and 5 years after today. I sould be able to change the years displayed on a autogenerated dropdown menu for "date" datatype.

jordillonch commented 10 years ago

We are using "plain Symfony2 forms". Just edit your form type class generated by the bundle and add something like:

->add('myDateField', 'date', array(
                'years' => range(Date('Y') - 20, date('Y'))
            ))