Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.2.16

Bug #4781 Without setDefaults(), date format doesn't work correctly.
Submitted: 2005-07-10 06:36 UTC
From: sakamoto-gsyc-3s at glamenv-septzen dot net Assigned: avb
Status: Closed Package: HTML_QuickForm
PHP Version: 4.3.11 OS: WinXP
Roadmaps: (Not assigned)    
Subscription  


 [2005-07-10 06:36 UTC] sakamoto-gsyc-3s at glamenv-septzen dot net
Description: ------------ I use HTML_QuickForm 3.2.4pl1 and ArraySmartyRenderer. Without setDefaults(), date format seems not to work correctly. Especially, 'prefix/suffix' parts, as 'format' key which passed in date element constructor, seems not to be outputted in html. I tried to solve this problem, I changed toHtml() in date.php like this and I could solve this problem. function toHtml() { // before $renderer->setElementTemplate($this->_wrap[0] . '{element}' . $this->_wrap[1]); parent::accept($renderer); return $renderer->toHtml(); // after $renderer->setElementTemplate('{element}'); parent::accept($renderer); eturn $this->_wrap[0].$renderer->toHtml().$this->_wrap[1]; } Reproduce code: --------------- $form->addElement('date', 'date1', 'date1_capt', array('format' => '--prefix-- Y m d --suffix--', ... // If use setDefaults(), '--prefix--', '--suffix--' are shown. $form->setDefaults(array('date1' => array('Y'=> ... // Without setDefaults(), those are NOT shown.

Comments

 [2005-07-22 14:28 UTC] avb
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.