addEvent
Description
添加一个新事件
addEvent: (event: any) => string
Parameters
event- (必填) object - 事件对象
Returns
id- (string) - 事件的 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
注释
该方法会触发 onEventAdded 或 onEventChanged 事件
事件对象可以包含以下属性:
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。如果未指定,将自动为该事件生成 ID。userdata- (hash) 以 '键值对' 形式呈现的一组自定义属性。
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.