【发布时间】:2013-09-20 08:03:26
【问题描述】:
我认为这个问题很简单,但我还是卡在这里。我想显示当前年份 + 未来 2 年。例如,如果现在是 2013 年,它将显示 2013、2014、2015 年,如果今年是 2014 年,它将显示 2014、2015、2016 年。
这是我的代码
$myCalendar->setYearInterval(date('Y'), 2015);
function setYearInterval($start, $end){
$this->year_start_input = $start;
$this->year_end_input = $end;
if(!$start) $start = $this->year_start;
if(!$end) $end = $this->year_end;
if($start < $end){
$this->year_start = $start;
$this->year_end = $end;
}else{
$this->year_start = $end;
$this->year_end = $start;
}
我确实将 2015 年更改为 +2 / -2,但显示的是 2011、2012、2013 年(当年 + 2 年前)。请帮忙。谢谢。
【问题讨论】:
-
我们能看看
setYearInterval函数里面的代码是什么吗? -
没有像
setYearInterval()这样的PHP核心函数。它从何而来?您在这里使用的是哪个日历类?
标签: php datepicker