JQuery FullCalendar timezone synchronization

I am using the jQuery Fullcalendar plugin (http://arshaw.com/fullcalendar). I use it only for "full day" events. When a user creates an event, I save it in my database via PHP as a date (2012-01-12). When sending an event list to FullCalendar via AJAX, I convert the date to Unix time.

The problem that I foresee is when the server is in the USA with the US time zone and the client is in Europe. The server sends an event on 2012-01-12 00:00:00 (US Time), which is converted during Unix. Then the client can see the event, which is located on 2012-01-12 08:00:00 (8 hours later).

How can I make sure that if the event is at midnight, then at midnight EVERYWHERE - you do not need to configure any time zone. If a user creates a full-day event on January 12th, I need every user around the world to see it on the same date.

+2
source share
1 answer

FullCalendar has an option for this, ignoreTimezone (see http://arshaw.com/fullcalendar/docs/event_data/ignoreTimezone/ ), just make sure that it is set to true (which is the default *), and the user will see the same time as the server, regardless of the user time zone.

(* I personally believe that the default value is incorrect, and the developer seems to confirm this in the docs, so it would be useful to specify explicitly.)

+5
source

All Articles