I have an application built on the basis of a full calendar based on jQuery http://arshaw.com/fullcalendar/
The events of my calendars are loaded by an Ajax call that outputs JSON, it is set to Monday as the first day of the week, and by default it is a week.
It works great, but I noticed that if I go out on the 13th week (starting March 26th), events will not load properly. I immediately realized that this should be due to the change in daylight saving time that occurs on March 25th.
When I click on the next / prev buttons, the calendar makes an ajax call using the automatically generated start and end time, my php script in the background takes the start date, calculates week no and triggers all the events in my database for this week.
For example, in week 12, the following variables are transferred:
?start = 1332115200 & end = 1332716400 & _ = 1331237729591
PHP script:
$week_no = date('W', $_GET['start']);
It works like week number 12.
However, the following variables passed in:
?start = 1332716400 & end = 1333321200 & _ = 1331238038820
$week_no = date('W',$_GET['start']); == 12 // same as last week
Further verification of Nn
echo date("C",1332115200); // == 2012-03-19T00:00:00+00:00 echo date("C",1332716400); //2012-03-25T23:00:00+00:00 (1 hour short of being in week 13)
Thus, it is obvious that changing daylight causes a problem.
My question is: is this a problem with fullcalander or my PHP logic?