Skip to content
Advertisement

Symfony problem with range Datetime (form)

I don’t understand my problem. If you can just give me an idea. I have a dateTime field who works but my field years have a bizzare range (2015-2025). I want to have a bigger range (e.g : 1960-2040).

JavaScript

Advertisement

Answer

As you can see here DateType::Class Refrence. The field will have options to configure how your choice box will behave. you can simply use php’s range() function to map out your Years in your code like : range(1960, 2040)

JavaScript

In your code simply use :

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement