考虑下面的代码是可以正常使用昨天,但现在今日(3月30日),它已停止工作......个月少于31天,从列表中省略
<form class="date">
<select name="date" onchange="this.form.submit()">
<?php
for ($i = 0; $i <= 60; ++$i) {
$time = strtotime(sprintf('+%d months', $i));
$value = date('Y-m', $time);
$label = date('F Y', $time);
$nowvalue = date('Y-m');
$nowlabel = date('F Y');
if(isset($_GET['date'])) {
if(strcmp($value,$_GET['date']) == 0) {
//If 0, $value and $_GET['date'] are the same: The option is selected
printf('<option value="%s" selected>%s</option>', $value, $label);
} else {
printf('<option value="%s">%s</option>', $value, $label);
}
} else {
if($value == $nowvalue) {
printf('<option value="%s" selected>%s</option>', $value, $label);
} else {
printf('<option value="%s">%s</option>', $value, $label);
}
}
}
?>
</select>
</form>
该输出的选择列表即将到来的几个月,onchange会在该页面上的日历的URL中使用不同的查询重新加载页面以作出反应。
如果我手动更新URL查询,它工作正常,但这种选择列表重复日期,看看下面的图片...
这不能是一个巧合在最短的日子里所有的月份都失踪了,或者实际上已经被替换为与前一个月相同的名字?
有没有人有一个想法,为什么这可能会发生?
这些问题出现在本月的31号... –