fullcalendar/docs/google-calendar.txt

68 lines
2.4 KiB
Text

Google Calendar
===============
To integrate with your Google Calendar, you must first **make your calendar public**:
#. In the Google Calendar interface, locate the "My Calendar" box on the left.
#. Click the arrow next to the calendar you need.
#. A menu will appear. Click "Share this calendar."
#. Check "Make this calendar public."
#. Make sure "Share only my free/busy information" is *unchecked*.
#. Click "Save."
Then, you must obtain your calendar's **XML feed URL**.
#. In the Google Calendar interface, locate the "My Calendar" box on the left
#. Click the arrow next to the calendar you need.
#. A menu will appear. Click "Calendar settings."
#. In the "Calendar Address" section of the screen, click the XML badge.
#. Your feed's URL will appear.
The ``$.fullCalendar.gcalFeed`` function produces an event source that can be
passed to the ``events`` or ``eventSources`` options::
$('#calendar').fullCalendar({
events: $.fullCalendar.gcalFeed(
"http://www.google.com/calendar/feeds/...", // feed URL
{ className: 'gcal-events' } // optional options
)
});
Here is a list of available options:
* **className** - CSS class to attach to each event from this Google Calendar
* **editable** - whether to allow dragging/resizing (default: ``false``)
* **currentTimezone** - a string like "America/Chicago". Consult http://php.net/manual/en/timezones.php for a full list.
See *gcal.html* in the *examples* directory for a complete example.
Timezones Gotchas
-----------------
Sometimes it can be confusing as to why FullCalendar displays event times differently
than the Google Calendar interface. There are the two factors involved in this:
* **the calendar's timezone**, accessed through "Calendar settings" after clicking the arrow next to the calendar's name
* **your Google Account's timezone**, accessed through the "Settings" link at the top right
of the Google Calendar screen (near the "Sign out" link)
When both timezones are the same, you should have no problems. When they are different, FullCalendar will display
times in the *calendar's* timezone. Thus, times will be different than what you see in the Google Calendar interface
because they are being adjusted to the GMT of the calendar. The solution is to use the ``currentTimezone`` option.
If this is set to the same timezone as your Google Account, all dates should appear consistent.