Hey Aadaam, I tried doing this:
$this->setDefault('startdate', date('Y-m-d')); and it works for me. Can you try it and see? Thanks, Susan On Sun, Feb 28, 2010 at 7:16 PM, Aadaam <aad...@gmail.com> wrote: > Hi all, > > I now this is a silly question, but I simply can't set a date widget > to a default value, nor I am able to understand how it is supposed to > work. > > What I tried: > > class SomeForm extends DoctrineForm { > public function configure(){ > $this->widgetSchema['startdate'] = new sfWidgetFormDate( > array( > 'format' => '%year% - %month% - %day%', > 'default' => array( > 'year'=> date('Y',$time), > 'month' => date('m', $time), > 'day' => date('j', $time) > ), > )); > > $this->setDefault('startdate', array( > 'year'=> date('Y',$time), > 'month' => date('m', $time), > 'day' => date('j', $time) > )); // also tried with date('Y-m-j').... > } > } > None of these works. I looked at the forums, looked at the sourcecode > of symfony 1.1,1.2 and 1.4. > > I'm using 1.2 currently, but I couldn't find a clue on how does this > widget take default into account at all. > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- "To categorize is human; to distribute, divine." -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en