First, I’ve attached the class in a text file to this post.
Here’s the issue:
I didn’t program this class and I’ve always had trouble figuring it out. We moved our site to a new server and now some months have incorrect dates on incorrect days (usually only off by one day/date).
So, here’s how it works. A query on the events table is run that grabs the events that start in the indicated month. It then runs a while loop and adds the dates it finds for the current month and year into the $cal object, like so:
while($data = mysql_fetch_array($result, MYSQL_ASSOC)) {
if($data['event_date'] > $month_start and $data['event_date'] < $month_end) {
$cal->add_event($data['event_title'], $data['event_date'], $data['event_length'], "events/event/{$data['event_id']}", $data['event_status'], $data['event_id']);
}
}Then, the calendar is displayed:
$body .= $cal->display(mktime(0,0,0,$month,1,$year));The $cal->display() method generates an HTML string which is added to $body for output.
I’ve tried all I can think of to fix this problem. You can see it further in the attachments I provided, which show October 2009, Nov 2009, and December 2009 - in this set of three, only November has the correct dates on the correct days. If you look at October, you’ll see it shows the 31st being on a Friday, when it should be on a Saturday.
The crap thing about this? I’ve ported this over to CI 1.7.1 as my own Library and it works FANTASTIC, with NO PROBLEMS!
Please please please! I know there’s some smart cookies here and I am literally on the floor, rolling around, banging my feet, crying and throwing a tantrum because I just need help to figure this out and get some people off my back. The fact that I’ve been at it for two weeks straight and have gone nowhere is seriously not helping me one bit.
Thanks everyone!