# GoogleCalendar(options: CalendarOptions)

Generates a Google Calendar instance.

# Example

import { GoogleCalendar } from 'datebook'

const options: CalendarOptions = {
  title: 'Happy Hour',
  location: 'The Bar, New York, NY',
  description: 'Let\'s blow off some steam with a tall cold one!',
  start: new Date('2022-07-08T19:00:00'),
  end: new Date('2022-07-08T23:30:00'),
  recurrence: {
    frequency: 'WEEKLY',
    interval: 2

const googleCalendar = new GoogleCalendar(options)

# setParam(key: string, value: string): GoogleCalendar

Sets a parameter on the URL. This may be used to either set additional optional properties, or override existing ones. Pass a value of null to remove an existing property.

Returns the GoogleCalendar instance.

# Additional properties

  • crm - Customer Relationship Management, as to how the event appears on the calendar. May be set to AVAILABLE, BUSY, or BLOCKING.
  • trp - Transparency (opens new window), to show an attendee as busy (true) or available (false).
  • src - The email address source Google calendar to add this event to.

# Example

  .setParam('crm', 'BUSY')
  .setParam('trp', 'true')
  .setParam('src', 'johndoe@example.com')

# render()

Returns a Google Calendar (opens new window) URL to a page that autofills a form in the online Gmail Calendar app with the event details.

# Example

# Result:

This will open a form in Google Calendar similar to the following:

Google Calendar result