| 1: | <?php |
| 2: | namespace TIC\FormBundle\Form\Type; |
| 3: | |
| 4: | |
| 5: | use TIC\FormBundle\Base\TICWidgetType as BaseType; |
| 6: | |
| 7: | use Symfony\Component\OptionsResolver\OptionsResolver; |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | class BirthdayType extends BaseType |
| 14: | { |
| 15: | |
| 16: | protected $form_parent = DateType::class; |
| 17: | protected $default_prefix = '<calendar>'; |
| 18: | protected $default_suffix = '<calendar>'; |
| 19: | |
| 20: | const INTERNAL_DATE_FORMAT = "yyyy-MM-dd"; |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | public function configureOptions(OptionsResolver $resolver): void |
| 27: | { |
| 28: | parent::configureOptions($resolver); |
| 29: | |
| 30: | $resolver->setDefaults(array( |
| 31: | 'placeholder' => false, |
| 32: | 'suffix' => true, |
| 33: | |
| 34: | |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | |
| 40: | 'minDate' => mktime(0, 0, 0, 1, 1, date('Y')-120), |
| 41: | 'maxDate' => time(), |
| 42: | 'viewDate' => mktime(0, 0, 0, 1, 1, date('Y')-40), |
| 43: | 'viewMode' => 'years', |
| 44: | 'buttons' => array('clear','close'), |
| 45: | )); |
| 46: | } |
| 47: | |
| 48: | |
| 49: | } |
| 50: | |