Re: QuickForm date element
| From: | Julie Knoll | Date: | Wed, 31 Dec 2003 15:46:01 +0000 |
| Subject: | Re: QuickForm date element | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9889@lists.php.net to get a copy of this message | ||
The code I'm using to insert the date element is:
$this->addElement('date' , 'date' , 'Date: ' ,
array('format' => 'Y-m-d' , 'minYear' => 1850 ,
'maxYear' => date('Y')));
The drop down menu looks fine. Each selection for the
month and day has the leading zero, but the value that
is actually submitted does not have the zero.
I can always check the length of the string after the
form is submitted and add the zero if needed, but I
was hoping there was a cleaner way.
I'm using this along with the PEAR date package
because my dates go back to far to use PHPs date
functions, but the package will not recognize the date
with only one digit for the month or day.
Thanks again.
--- Massimiliano Bariola <m.bariola@redlinkitalia.it>
wrote:
> Hello Julie,
>
> Tuesday, December 30, 2003, 7:33:46 PM, you wrote:
>
> JK> I've noticed that the quickform date element
> drops the
> JK> leading zero for month and day values in the
> HTML
> JK> code:
>
> JK> <option value="3">03</option>
>
> JK> Is there anyway to keep that leading zero?
>
> My guess: Check the format of the string you
> pass to all the involved date
> objects.
>
> You can find what you need in the php
> documentation for the date()
> function
>
> Bye
>
> --
> Best regards,
> Ing. Massimiliano Bariola Cell: ++39 329
> 3570098
> REDLINK Italia S.a.s
> http://www.redlinkitalia.it
> mailto:m.bariola@redlinkitalia.it
> PGP Key:
> http://www.redlinkitalia.it/PGP/MB_PGPKEY.txt
>
__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003