I would like to integrate the jQuery fullcalendar into my PHP website, but I don\'t know how to handle the event and how to use the JSON data from MySQL.
Any advice wou
I'm not familiar with jquery. But I think the problem is that you are not taking into account the asynchronous nature of Ajax.
Unless fullCalendar() does something very odd (fires off an Ajax request and waits for the response), then you will not be able to use an external source in the function in that way, because fullCalendar will have finished running by the time a response comes back from the server.
There does not appear to be a clear example of what you are trying to do on the Week Calendar webpage, but I am sure that what you need is to create the calendar without the events, but with a callback defined for adding events; and then in some way fire off the external call.
"2010-02-11 11:00:00" format works fine to specify time for me (without "T" inside), the key of the solution is to set the "allDay" attribute of an event to empty string.
the output to echo an event should be in this format:
$('#calendar').fullCalendar({
events: [{
title: 'Awesome Event Title',
start: new Date($start_year, $start_month, $start_day), or end: new Date(y, m, d),
end: new Date($end_year, $end_month, $end_day) or end: new Date(y, m, d)
}]
});
I think your having the same problem as I'm having. I've search the web trying to find out how to setup the DateTime so that the fullCalendar javascript will interpret it correctly. (This page had some good clues to that: http://blog.stevenlevithan.com/archives/date-time-format).
I posted this on the fullCalendar issues page hoping that the creator or anyone else would shed some light on the subject.
====================ISSUE DESCRIPTION====================
What steps will reproduce the problem?
[{"id":2, "title":"title of 2","start":"2009-11-17T10:00:00" ,"end":"2009-11-17T11:01:00","url":"?eventID=2"}]
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
I am using an aspx page for fetching the calendar events. My guess is that
there is something wrong with the format of the JavaScript DateTime
object
that I'm returning in the JSON
and that this is causing the fullcalendar
to
interpret the events as fullDayEvents
. The format that I'm sending in the
JSON
is: 2009-11-17T11:01:00
.
Hey, I have not used your code above, but in json_events.php the default one, there is "[" in the start of php output and "]" on the end.
In PHP - JSON:
$eventsArray['allDay'] = "false"; //doesn't work
$eventsArray['allDay'] = false; //did the trick to have a NON FULL DAY correctly rendered!!