Skip to content

Z.Calendar

The Z.Calendar object is used to add calendar events to the user’s calendar. When the add(...) function is called the user is presented with an OS-provided dialog box for customizing the event before choosing to save it to their calendar or discard it.

This object is accessed using a global instance at Z.calendar.

The add(…) page has examples of adding events to the calendar.

Z.Calendar uses JavaScript’s standard Date object for representing dates and times. This Date object, somewhat bizarrely, uses zero-based numbers for months - i.e. January is 0, February is 1, etc. For more information see the Mozilla Developer Network Date article.

When adding an event to your calendar without a time zone, the event will be scheduled for the default time zone.

To include your timezone in the event, add the following string:

Z.calendar.add({
title: "Title",
start: new Date('Feb 20 2019 9:00:00 PST'),
end: new Date('Feb 20 2019 14:00:00 PST'),
location: "Location",
notes: "notes"
});