problem with html_quick_form date
| From: | Jerry | Date: | Tue, 29 Jun 2004 07:56:32 +0000 |
| Subject: | problem with html_quick_form date | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-13400@lists.php.net to get a copy of this message | ||
Good morning
I've a problem with html_quick_form date element . I've the following error
message :
Notice: strtotime(): Called with empty time parameter in
/var/www/appli-box.com/htdocs/pear/PEAR/HTML/QuickForm/date.php on line 373
Could someone help me??
Here's my script :
function preGenerateForm(&$formBuilder)
{
$el = array();
$tabattributes['language']='fr';
$tabattributes['minYear']='2004';
$el['OPR'] = &HTML_QuickForm::createElement('date', 'OPR',
'OPR',$tabattributes);
$this->preDefElements = &$el;
}
function postGenerateForm(&$form)
{
if(isset($this->id)){
$tabOPR=array('d' => date('d', strtotime($this->OPR)), 'M'
=> date('m',
strtotime($this->OPR)), 'Y' => date('Y', strtotime($this->OPR)));
}else{
$tabOPR=array('d' => date('d'), 'M' => date('m'),
'Y' => date('Y'));
}
$constantValues['OPR'] = $tabOPR ;
$form->setDefaults($defaultsValues);
$form->setConstants($constantValues);
}