Skip to main content

API overview

Event Calendar constructor

new eventCalendar.EventCalendar("#root", {
// configuration parameters
});

Parameters:

  • an HTML container (the ID of the HTML container)
  • an object of the configuration parameters (check here)

Event Calendar methods

NameDescription
addCalendar()Adds a new calendar
addEvent()Adds a new event (without opening an editor)
closeEditor()Closes an editor
createEvent()Creates a new event and opens an editor
deleteCalendar()Removes a calendar by its ID
deleteEvent()Removes an event by its ID
destructor()Removes all HTML elements of Event Calendar, and detaches all related events
getCalendar()Gets an object of the calendar data by its ID
getEvent()Gets an object of the event data by its ID
hideEventInfo()Hides an info popup window
openEditor()Opens an editor for an event by its ID
parse()Parses data into Event Calendar (for events and calendars)
serialize()Serializes Event Calendar data to JSON
setConfig()Sets the config parameters of Event Calendar
setDate()Sets a current date of Event Calendar
setLocale()Applies a new locale to Event Calendar
setMode()Sets a view mode of Event Calendar
setTheme()Sets a theme of Event Calendar
showEventInfo()Shows an info popup for the event by its ID
toggleSidebar()Shows/hides a sidebar
updateCalendar()Updates the calendar data by its ID
updateEvent()Updates the event data by its ID

Event Calendar internal API

Event Bus methods

NameDescription
api.exec()Allows triggering the inner events
api.intercept()Allows intercepting and preventing the inner events
api.on()Allows attaching a handler to the inner events
api.setNext()Allows adding some action into the Event Bus order

State methods

NameDescription
api.getReactiveState()Gets an object with the reactive properties of the Event Calendar StateStore
api.getState()Gets an object with the current properties of the Event Calendar StateStore
api.getStores()Gets an object with the DataStore of Event Calendar

Event Calendar events

NameDescription
add-calendarFires when adding a new calendar
add-eventFires when adding a new event
close-event-infoFires when closing an event info popup window
delete-calendarFires when removing a calendar
delete-eventFires when removing an event
edit-eventFires when editing an event
select-eventFires when showing an info popup window
set-boundFires when making a next/previous step (date) in a calendar
set-dateFires when setting a new date
set-modeFires when setting a view mode
toggle-sidebarFires when showing/hiding a sidebar
update-calendarFires when updating the calendar data
update-eventFires when updating the event data

Event Calendar properties

NameDescription
calendarsOptional. An array of objects containing the calendars (event types) data
colorsOptional. An array of objects containing the parameters of colors used in colorpicker
configOptional. An object of the Event Calendar configuration
dateOptional. A selected date of Event Calendar
editorShapeOptional. An array of objects containing settings for managing the appearance and functionality of the Event Calendar editor
eventsOptional. An array of objects containing the events data
localeOptional. An object of the built-in or custom locale
modeOptional. An initial view mode of Event Calendar
sidebarOptional. An object of the sidebar configuration
templatesOptional. An object with custom templates of the Event Calendar visual elements
themeOptional. An initial theme of Event Calendar

RestDataProvider API

RestDataProvider methods

NameDescription
getCalendars()Gets a promise with the calendars data
getEvents()Gets a promise with the events data
send()Sends a necessary HTTP request to the server and returns a promise with or without data depending on the request

RestDataProvider routes

NameDescription
GET /calendarsGets data on all calendars and returns a json object with an array of calendars objects
GET /eventsGets data on all events and returns a json object with an array of events objects
GET /uploadsGets the requested binary file from the server
POST /eventsCreates a new event and returns a json object with the event ID in it
POST /calendarsCreates a new calendar (event type) and returns a json object with the calendar ID in it
POST /uploadsUploads a binary file to the server and returns a json object with the file id, name, and url
PUT /eventsUpdates data on an event
PUT /calendarsUpdates data on a calendar (event type)
DELETE /eventsDeletes data on an event
DELETE /calendarsDeletes data on a calendar (event type)