Im using JQuery Full Calendar Plugin. Code:
$('#mycalendar').fullCalendar({
** options **
events: function(start, end, callback) {
$.ajax({
url: '/myloader/',
dataType: 'json',
data: {
// our hypothetical feed requires UNIX timestamps
start: Math.round(start.getTime() / 1000),
end: Math.round(end.getTime() / 1000)
}
*** more stuff
});
now on myloader php side when i try to get start and end dates here is what i get:
var_dump(date('m/d/Y H:i:s', $_GET['start']), date('m/d/Y H:i:s', $_GET['end']));
this returns:
string(19) "01/27/2013 06:00:00"
string(19) "03/10/2013 06:00:00"
why is it 6:00:00 ? i want it to be 00:00:00 for start and 23:59:59 for end
I know i can hack through it using PHP but is there a reason why full calendar returns such date?
If i use PHP i can get desired results using:
$start = strtotime(date('m/d/Y', $start) . ' 00:00:00');
$end = strtotime(date('m/d/Y', $end) . ' 23:59:59');
but i dont want to do it on PHP side is there a way full calendar to give correct time? If its a timezone issue how can it be fixed?
thanks