Birthdate validation
We have the request to better validate birthday in Person form.
I propose to create a "BirthdayValidator" which will :
- by default, prevent date in the future to be recorded ;
- a special key in the configuration will prevent date after a defined period to be recorded. For instance, an association is not allowed to receive people which are less than 18 years old. Birthdate after the 9/12/1997 are not allowed.
Practically, I propose to create a special key in configuration of the bundle :
chill_person:
validation:
birthday_not_after: 18Y
The format of the key will be the same as the DateInterval, which is also the same as ISO 8601.
See also : http://symfony.com/doc/current/cookbook/validation/custom_constraint.html