跳转到主要内容

addEvent

Description

添加一个新事件

addEvent: (event: any) => string

Parameters

  • event - (required) object - 事件对象

Returns

  • id - (string) - 事件的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

注释

该方法会触发 onEventAddedonEventChanged 事件

事件对象可以包含以下属性:

  • start_date - (Date,string) 事件开始的日期。如果以字符串形式提供,应遵循 "%d-%m-%Y %H:%i" 格式(如需调整默认格式,请参阅 api_date 选项)。对于重复事件start_date 必须是 Date 类型。
  • end_date - (Date,string) 事件预期结束的日期。如果以字符串形式提供,应使用 "%d-%m-%Y %H:%i" 格式(如需修改默认格式,参见 api_date 选项)。对于重复事件end_date 必须是 Date 类型。
  • text - (string) 事件描述。
  • id - (string) 事件标识符。如果省略,将自动生成一个id。
  • userdata - (hash) 一组自定义属性,以"键-值"对形式表示。
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.