Skip to main content

addEvent

Description

Adds a new event

addEvent: (event: any) => string

Parameters

  • event - (required) object - the event object

Returns

  • id - (string) - the event's id

Example

scheduler.addEvent({
start_date: "16-06-2013 09:00",
end_date: "16-06-2013 12:00",
text: "Meeting",
holder: "John", // userdata
room: "5" // userdata
});

Details

note

The method invokes the onEventAdded or onEventChanged event

The event object can have the following properties:

  • start_date - (Date,string) the date, when the event is scheduled to begin. If the property is specified as a string, the "%d-%m-%Y %H:%i" format should be used (to change the default format, use the api_date option). For recurring events the value of the start_date property must have the Date type.
  • end_date - (Date,string) the date, when the event is scheduled to be completed. If the property is specified as a string, the "%d-%m-%Y %H:%i" format should be used (to change the default format, use the api_date option). For recurring events the value of the end_date property must have the Date type.
  • text - (string) the event's text.
  • id - (string) the event's id. If not specified, the id for the event will be generated automatically.
  • userdata - (hash) a collection of custom properties presented as 'key-value' pairs.
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.