Php 删除CodeIgniter日历中传递的日期

Php 删除CodeIgniter日历中传递的日期,php,codeigniter,Php,Codeigniter,是否可以删除中已经过去的日期 我正在使用用户的中提供的日历模板,这是可能的,尽管我不知道这是否是常规的。这是我的代码 保存到“/application/libraries/MY_Calendar.php” 威廉·克纳斯(William Knauss)的以下答案是开箱即用的(威廉,我为你感到荣幸)。 我实际上更进一步,根据我的需要调整了William的解决方案。 基本上,我希望过去的日子是残废的。就像在中一样,我想在过去的几天里为td元素设置一个I类,在将来(包括今天)为元素设置一个不同的类。 因

是否可以删除中已经过去的日期


我正在使用用户的

中提供的日历模板,这是可能的,尽管我不知道这是否是常规的。这是我的代码

保存到“/application/libraries/MY_Calendar.php”


威廉·克纳斯(William Knauss)的以下答案是开箱即用的(威廉,我为你感到荣幸)。
我实际上更进一步,根据我的需要调整了William的解决方案。
基本上,我希望过去的日子是残废的。就像在中一样,我想在过去的几天里为td元素设置一个I类,在将来(包括今天)为元素设置一个不同的类。
因此,从第106行开始的代码如下所示:

if ($day < date('d')) {
    $out .= ($is_current_month === TRUE && $day == $cur_day) ? $this->replacements['cal_cell_start_today'] : $this->replacements['cal_cell_start_past'];
}else{
    $out .= ($is_current_month === TRUE && $day == $cur_day) ? $this->replacements['cal_cell_start_today'] : $this->replacements['cal_cell_start'];
}

if (isset($data[$day])) { // this part was restored to the way it is in the native class.
     // Cells with content...
if($dayreplacements['cal\u cell\u start\u today']:$this->replacements['cal\u cell\u start\u pass';
}否则{
$out.=($is_current_month===TRUE&&$day==$cur_day)?$this->replacements['cal_cell_start_today']:$this->replacements['cal_cell_start'];
}
if(isset($data[$day]){//此部分已恢复为本机类中的状态。
//包含内容的单元格。。。
请注意“cal\u cell\u start\u pass”。这是本机类中默认模板数组中的一个新数组属性。从第473行开始。
现在看起来是这样的:

'cal_row_start'             => '<tr>',
'cal_cell_start_past'       => '<td class="pastDay">',
'cal_cell_start'            => '<td class="day">',
'cal_cell_start_today'      => '<td class="day">',
'cal\u row\u start'=>',
“cal_cell_start_past'=>”,
“cal_cell_start'=>”,
“cal_cell_start_today”=>“,

希望这对其他人有所帮助。

那么你想从哪里开始日期?我不认为过去的日子可以从日历中删除。应该可以将颜色更改为灰色,使它们看起来不活跃。哦,好的。顺便说一句,谢谢。我们如何将所有经过的日期的颜色更改为灰色?
if ($day < date('d')) {
    $out .= ($is_current_month === TRUE && $day == $cur_day) ? $this->replacements['cal_cell_start_today'] : $this->replacements['cal_cell_start_past'];
}else{
    $out .= ($is_current_month === TRUE && $day == $cur_day) ? $this->replacements['cal_cell_start_today'] : $this->replacements['cal_cell_start'];
}

if (isset($data[$day])) { // this part was restored to the way it is in the native class.
     // Cells with content...
'cal_row_start'             => '<tr>',
'cal_cell_start_past'       => '<td class="pastDay">',
'cal_cell_start'            => '<td class="day">',
'cal_cell_start_today'      => '<td class="day">',