需要添加依赖模块: calendar模块
/**
*
[string] title //显示提醒的文案
[string] startDate //事件开始时间 格式为YYYY-MM-dd hh:mm:ss 年月日时分秒
[string] endDate //事件结束事件,单次提醒就跟startTime相同即可
[string] link //跳转到的url
[string] remind //提前几秒提醒,比如抢购在10:00开始,startTime = 2014-12-12 10:00:00,remind =180,那就是提前3分钟提醒【注意,starttime为开始时间,remind为提前量,调用方不需要自己换算时间】
[string] description //扩展字段,保存其他信息,用不到可置空
*/
Tida.calendar.add({
title: "日历测试",
startDate: "2015-07-09 14:20:00",
endDate: "2015-07-09 14:40:00",
link: "http://m.tmall.com",
description: "description"
}, function(result) {
alert(JSON.stringify(result));
if (result.errorCode) {
// 添加日历失败
} else {
// 添加日历成功
}
});