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: "2027-06-16 09:00",
end_date: "2027-06-16 12:00",
text: "Meeting",
holder: "John", // userdata
room: "5" // userdata
});
Related samples
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 theapi_dateoption). For recurring events, the value of thestart_dateproperty 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 theapi_dateoption). For recurring events, the value of theend_dateproperty 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.
Related API
Related Guides
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.