It looks like you're new here. If you want to get involved, click one of these buttons!
$day = substr(<date from database>,8,2)
and input it as $data[$day] = <data from database>
and pass that to CI's calendar class. It worked fine for me but I noticed the days that are less than 10 and have contents were not showing data like all other days do. I looked into CI's calendar class and found the tiny bug. During this part:if (isset($data[$day]))
{
// Cells with content
$temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content'];
$out .= str_replace('{day}', $day, str_replace('{content}', $data[$day], $temp));
}
else
{
// Cells with no content
$temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_no_content_today'] : $this->temp['cal_cell_no_content'];
$out .= str_replace('{day}', $day, str_replace('{class}', $class, $temp));
}
if($day < 10)
{
$dayString = '0' . strval($day);
}
else
{
$dayString = strval($day);
}
if (isset($data[$dayString]))
{
// Cells with content
$temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content'];
$out .= str_replace('{day}', $day, str_replace('{content}', $data[$dayString], $temp));
}
else
{
// Cells with no content
$temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_no_content_today'] : $this->temp['cal_cell_no_content'];
$out .= str_replace('{day}', $day, str_replace('{class}', $class, $temp));
}