addEvent

adds a new event

string addEvent(object event);
eventobjectthe event object
stringthe 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
});

Related samples

Details

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.
See also
Back to top