[symfony-users] Re: sfWidgetFormJQueryDate as default in auto generated code
On 27 Nov, 14:18, kev wrote: > Hey Massimiliano, > > i'd be more than happy to try your solution, but to be honest you page > is not that clear and definitely not symfony oriented. Maybe you could > describe what exactly is needed, where to put it and what file to > update for your solution to work in a symfony project! > > Thanks anyway. As stated in the top of the page, you just need the javascripts and stylesheet (you can save it from the links). I hope you're able to use symfony helpers to do it, otherwise you should read official documentation. -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@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.
[symfony-users] Re: sfWidgetFormJQueryDate as default in auto generated code
Hey Massimiliano, i'd be more than happy to try your solution, but to be honest you page is not that clear and definitely not symfony oriented. Maybe you could describe what exactly is needed, where to put it and what file to update for your solution to work in a symfony project! Thanks anyway. On 27 nov, 13:57, Massimiliano Arione wrote: > On 9 Ott, 17:04, axel at wrote: > > > > > > > hello list, > > > 1) is there a way to make sfWidgetFormJQueryDate the default widgets > > for datetime fields in autogenerated code (Base*Form.classes) > > > eg: > > class BaseTutorialForm extends BaseFormDoctrine > > { > > public function setup() > > { > > $this->setWidgets(array( > > 'id' => new sfWidgetFormInputHidden(), > > > > 'created_at' => new sfWidgetFormJQueryDate > > (sfConfig::get('sf_date_widget_settings')), > > > > > You should avoid to use such plugin, since it's a bad idea to mix php/ > html and javascript. > Javascript should be provided only by other Javascript code. > You can give a try to my pure Javascript > solution:http://garakkio.altervista.org/datepicker/ -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@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.
[symfony-users] Re: sfWidgetFormJQueryDate as default in auto generated code
On 9 Ott, 17:04, axel at wrote: > hello list, > > 1) is there a way to make sfWidgetFormJQueryDate the default widgets > for datetime fields in autogenerated code (Base*Form.classes) > > eg: > class BaseTutorialForm extends BaseFormDoctrine > { > public function setup() > { > $this->setWidgets(array( > 'id' => new sfWidgetFormInputHidden(), > > 'created_at' => new sfWidgetFormJQueryDate > (sfConfig::get('sf_date_widget_settings')), > > You should avoid to use such plugin, since it's a bad idea to mix php/ html and javascript. Javascript should be provided only by other Javascript code. You can give a try to my pure Javascript solution: http://garakkio.altervista.org/datepicker/ -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@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.
[symfony-users] Re: sfWidgetFormJQueryDate as default in auto generated code
Hey Axel, not sure whether you found you answer, but i did! :) It apparently cannot be done from the "generator.yml" conf file. So in your "lib/form/doctrine/BackendTutorialForm.class.php" file you need to add : ... public function configure() { ... $this->widgetSchema['expires_at'] = new sfWidgetFormJQueryDate (array('format'=>'%day%/%month%/%year%')); $this->widgetSchema['created_at'] = new sfWidgetFormJQueryDate (array('format'=>'%day%/%month%/%year%')); } ... If you leave the sfWidgetFormJQueryDate() method call without any params it will take the default date format mm/dd/. Because i'm in Europe, i changed that format, just as an extra tip! ;) Hope it helped! On 27 nov, 12:30, kev wrote: > Hello axel, > > have you found a solution to that problem? I'm also trying to those 2 > things sorted for both "filter" and "add/edit" forms. > > Thanks! > > On 9 oct, 17:04, axel at wrote: > > > > > hello list, > > > 1) is there a way to make sfWidgetFormJQueryDate the default widgets > > for datetime fields in autogenerated code (Base*Form.classes) > > > eg: > > class BaseTutorialForm extends BaseFormDoctrine > > { > > public function setup() > > { > > $this->setWidgets(array( > > 'id' => new sfWidgetFormInputHidden(), > > > > 'created_at' => new sfWidgetFormJQueryDate > > (sfConfig::get('sf_date_widget_settings')), > > > > > > 2) how can I change thedateformatinadminautogeneratorfor input > > fields eg. fordatefilters > > I've tried something like > > form: > > class: BackendTutorialForm > > display: > > Content: [category_id, type, is_public, email] > > Admin: [_generated_token, is_activated, expires_at, > > created_at] > > fields: > > expires_at: { label: works, date_format:dd/MM/ } > > created_at: { label: for me, date_format:dd/MM/ } > > > where the lables for expires_at and created_at are displayed correctly > > but the date_format settings don't have any effect in the edit/create > > form > > > (using symfony 1.2.8 with doctrine) > > thx a lot -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@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.
[symfony-users] Re: sfWidgetFormJQueryDate as default in auto generated code
Hello axel, have you found a solution to that problem? I'm also trying to those 2 things sorted for both "filter" and "add/edit" forms. Thanks! On 9 oct, 17:04, axel at wrote: > hello list, > > 1) is there a way to make sfWidgetFormJQueryDate the default widgets > for datetime fields in autogenerated code (Base*Form.classes) > > eg: > class BaseTutorialForm extends BaseFormDoctrine > { > public function setup() > { > $this->setWidgets(array( > 'id' => new sfWidgetFormInputHidden(), > > 'created_at' => new sfWidgetFormJQueryDate > (sfConfig::get('sf_date_widget_settings')), > > > > 2) how can I change thedateformatinadminautogeneratorfor input > fields eg. fordatefilters > I've tried something like > form: > class: BackendTutorialForm > display: > Content: [category_id, type, is_public, email] > Admin: [_generated_token, is_activated, expires_at, > created_at] > fields: > expires_at: { label: works, date_format:dd/MM/ } > created_at: { label: for me, date_format:dd/MM/ } > > where the lables for expires_at and created_at are displayed correctly > but the date_format settings don't have any effect in the edit/create > form > > (using symfony 1.2.8 with doctrine) > thx a lot -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@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.