Problem/bug ApPHP Calendar [SOLVED]

Discuss everything related to ApPHP Calendar. All versions. Any questions related to the ApPHP Calendar developing or using should be posted to this forum.

Moderator: alexandrleonenko

gertdejongjr
Newbie
Newbie
Posts: 1
Joined: Oct 17th, '09, 11:40

Problem/bug ApPHP Calendar [SOLVED]

Postby gertdejongjr » Oct 17th, '09, 11:43

check this: http://sp.gertdejong.nl/test2/code_example.php

Today it is saturday Oct 17th, but the calendar sets today on sunday. A bit strange and I think it's a bug...

Can someone explain me how to resolve this?

Thanks! Gert
The Netherlands

administrator
Site Admin
Site Admin
Posts: 6011
Joined: Jan 7th, '09, 23:18
Contact:

Re: Problem/bug ApPHP Calendar

Postby administrator » Oct 17th, '09, 18:43

Please try to change to your local time
$objCalendar->SetTimeZone("America/Los_Angeles"); ?

the calendar shows date according to these settings or server settings.

administrator
Site Admin
Site Admin
Posts: 6011
Joined: Jan 7th, '09, 23:18
Contact:

Re: Problem/bug ApPHP Calendar

Postby administrator » Oct 22nd, '09, 19:11

This issue fixed.

To fix it manually, find in DrawWeek() method of calendar.class.php

for($i = $this->weekStartedDay-1; $i < $this->weekStartedDay+6; $i++){
echo "<td class='th'>".$this->arrWeekDays[($week_day % 7)][$this->weekDayNameLength]."</td>";
}

and replace with this code:

for($i = $this->weekStartedDay-1; $i < $this->weekStartedDay+6; $i++){
$week_day = date("w", mktime(0,0,0,$this->arrParameters["month"],$this->arrParameters["day"]+$i,$this->arrParameters["year"]));
echo "<td class='th'>".$this->arrWeekDays[($week_day % 7)][$this->weekDayNameLength]."</td>";
}


Return to “ApPHP Calendar”