In Symfony how to set default values to sfWidgetFormDateRange from action
views:
248answers:
1
+1
A:
Basically you have to do the following:
$form->setDefault('field_name', array('from' => 'yesterday', 'to' => '+10 years'))
These yesterday and +10 years chants actually are anything suitable for strtotime function. Also, you could pass explicit dates without casting any magic:
$form->setDefault('field_name', array('from' => array('month' => 10, 'day' => 12, 'year' => 1984), 'to' => '+10 years'))
develop7
2010-03-17 16:58:32