gmu.createCalendar(Object object)

用于向系统日历增加事件。

参数

Object object

属性 类型 默认值 必填 说明
startDate string 开始时间,格式:yyyy-MM-dd hh:mm:ss ,示例:2019-6-12 15:05:00
endDate string 结束时间,格式同开始时间,默认值为开始时间,不填或所填时间小于开始时间,则为默认值
title string 标题
location string 位置信息
alarmOffset number 提前提醒时间,单位:分 ,默认值为0,即事件开始时间提醒。注意事项:类型必须为整数,入参小于0时为默认值,安卓系统不传endDate字段时默认不提醒
success function 接口调用成功的回调函数
fail function 接口调用失败的回调函数
complete function 接口调用结束的回调函数(调用成功、失败都会执行)

object.success 回调函数

Object res

属性 类型 说明
id string 事件id

示例代码

gmu.createCalendar({
"title":"Light日历提醒",
"location":"hangzhou",
"startDate":"2019-6-26 14:35:00",
"endDate":"2019-6-26 14:40:00",
"alarmOffset":1,
success(res){
console.log(res.id);
}
})

注意事项

需要在APP的config.js配置文件中做以下配置:

module.exports = {
plugins:{
"calendar": {}
}
};