note 53205 deleted from function.checkdate by cece
| From: | cece@php.net | Date: | Tue, 15 Nov 2005 14:37:50 +0000 |
| Subject: | note 53205 deleted from function.checkdate by cece | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-98594@lists.php.net to get a copy of this message | ||
Note Submitter: cdblog at gmail dot com
----
today, when I use the html_select_date in Smarty, I found there is a bug when it show Day,
it always generate 31 days, I find the plugin at Smarty's plugins directory, the name is
function.html_select_date.php
so add the checkdate at the generate days, you can get the right days when you change the Month or
Years.
<?
......
for ($i = 1; $i <= 31; $i++) {
// add the checkdate
if (checkdate($time[1],sprintf($day_value_format, $i),$time[0])) {
$days[] = sprintf($day_format, $i);
$day_values[] = sprintf($day_value_format, $i);
} // end if
}
.....
?>
you can get detail from http://php.clickz.cn or send email to me
to get the modified code.
this resource's url is http://php.clickz.cn/articles/date/checkdate.html