I have a an application built with the jQuery based fullCalendar http://arshaw.com/fullcalendar/
My calendars events are loaded by an Ajax call that outputs JSON, it is configured to have Monday as the first day of the week and the default view is week.
It has been working fine, but I noticed that if I go forward to week 13 (beginning March 26th) the events are not loading properly. I figured straight away this must have something to do with daylight savings time changing which happens March 25th.
When I use the click on the next/prev buttons the calendar makes an ajax call using automatically generated start and end times, my php script on the background takes the start date calculates the week no and calls all the events in my database for that week.
For example on week 12 teh following variables are passed:
?start=1332115200&end=1332716400&_=1331237729591
PHP script:
$week_no = date('W', $_GET['start']);
Which works out as week no 12.
However the following week the variables passed are:
?start=1332716400&end=1333321200&_=1331238038820
$week_no = date('W',$_GET['start']); == 12 // same as last week
Nn further examination
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)
So obviously teh daylight change is causing the problem.
My question is, is this a problem with fullcalander or my PHP logic?