Sweet! It’s working now.
There are a couple of things that happened that I didn’t expect and I was wondering if you are experiencing the same.
When I first go to my test calendar, September is the current month but the first day of the month is on Monday instead of Tuesday and if I go to the next month and then back it’s correct. I get the same result on your demo page http://www.sterlingsavvy.com/tutorials/calendar/.
The other thing I did not expect, is when switching to the next or previous month, the current-day number is highlighted for that month too. I personally would prefer to have only the current day for the current month highlighted and I think it would go something like this (?)…
/* keep going with days.... */
for($list_day = 1; $list_day <= $days_in_month; $list_day++):
if(($list_day == date("j",mktime(0,0,0,$this->month))) && (date("F") == date("F",mktime(0,0,0,$this->month)))) [b]<<<<< - I added another condition to compare the current month with this->month.[/b]
{
$this->calendar.= '<td class="'. $this->style .'-current-day">';
}
else
{…
This seems to work but I’m not really sure if I accomplished my goal in the best way.
Thanks again for all your help.
Jim
PS. I Just realized I should test for the year too. So I changed the conditional test to…
if(($list_day == date("j",mktime(0,0,0,$this->month))) &&
(date("F") == date("F",mktime(0,0,0,$this->month))) &&
(date("Y") == date("Y",mktime(0,0,0,$this->month,$list_day,$this->year))))
{