Re: Date/Calc.php
| From: | Yavor Shahpasov | Date: | Fri, 08 Feb 2002 18:16:49 +0000 |
| Subject: | Re: Date/Calc.php | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-4504@lists.php.net to get a copy of this message | ||
Simon H said:
> I had this in the General list, but figured I might get a better
> response from the author here.
>
> I was wondering if anyone could explain how I can use the
> "getMonthFullname" function, and how to use the Date_calc Class in
> general. Are there any docs or examples?
>
> I'm trying to use the above-mentioned function to populate a pulldown
> like below, but the result I'm getting currently is:
>
> <SELECT NAME="TrialStart_month"><option
> value="1"></option>
try this, it should give you a drop down with month names
if (isset($select_name_month))
{
echo '<SELECT NAME="' .$select_name_month .
'">';
for ($i=1; $i<=12; $i++)
{
echo '<option value="' . $i . '"';
if (isset($month) && $month == $i)
{
echo ' SELECTED';
}
echo '>';
echo Date_Calc::getMonthFullname($i);
echo ' </option>';
}
echo '</SELECT> ';
}
getFullMonthFullName and getWeekFullName should return the day of the
month and week respectively when you provide them with a number (month
1=Januarry, weekday expects a day,month and a year and will return the
name of the day for that date (monday, tuesday etc) )
As for using Date_Calc I think the docs are not done for it, if you have a
spesific not too long question ask or use the source
Yavor
--
# chown -R us:us yourbase
*** Get your Personalized Email at www.freemail.com.cy ***
**Powered by NetSmart.Com.Cy**