Back to Fullcalendar

FullCalendar Google Calendar Plugin

packages/google-calendar/README.md

7.0.01.1 KB
Original Source

FullCalendar Google Calendar Plugin

Display events from a public Google Calendar feed

Installation

Install the FullCalendar vanilla-JS package, the Google Calendar plugin, and any other plugins (like daygrid):

sh
npm install fullcalendar @fullcalendar/google-calendar temporal-polyfill

Usage

Instantiate a Calendar with the necessary plugin:

js
import { Calendar } from 'fullcalendar'
import classicThemePlugin from 'fullcalendar/themes/classic'
import dayGridPlugin from 'fullcalendar/daygrid'
import googleCalendarPlugin from '@fullcalendar/google-calendar'

import 'fullcalendar/skeleton.css'
import 'fullcalendar/themes/classic/theme.css'
import 'fullcalendar/themes/classic/palette.css'

const calendarEl = document.getElementById('calendar')
const calendar = new Calendar(calendarEl, {
  plugins: [
    googleCalendarPlugin,
    dayGridPlugin,
    classicThemePlugin
  ],
  initialView: 'dayGridMonth',
  events: {
    googleCalendarId: '[email protected]'
  }
})

calendar.render()