tt.deleteCalendarEvent
基础库 2.72.0 开始支持本方法,这是一个异步方法。
删除通过button组件写入系统日历能力添加的日历。
| 前提条件 | 无 |
| 业务背景 | 无 |
| 使用限制 | 该能力需申请权限使用,满足申请条件后,开发者登录控制台,在小程序应用中筛选“能力-页面及信息-用户能力”,同时申请添加日历/查询日历/删除日历能力,能力使用规范详情查看日历能力开通及使用规范;申请条件如下:
|
| 注意事项 | 无 |
| 支持沙盒 | 否 |
| 相关教程 | 无 |
语法
tt.deleteCalendarEvent(options)
参数说明
options 为 object 类型,属性如下:
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 最低支持版本 |
|---|---|---|---|---|---|
| endTime | number | 否 | 结束时间的 unix 时间戳(1970年1月1日开始所经过的时间) | 2.72.0 | |
| title | string | 是 | 日历事件标题 | 2.72.0 | |
| startTime | number | 是 | 开始时间的 unix 时间戳(1970年1月1日开始所经过的时间) | 2.72.0 | |
| success | function | 否 | 接口调用成功的回调函数 | 2.72.0 | |
| fail | function | 否 | 接口调用失败的回调函数 | 2.72.0 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | 2.72.0 |
回调成功
object 类型,属性如下:
| 属性名 | 类型 | 说明 | 最低支持版本 |
|---|---|---|---|
| errMsg | string | "deleteCalendarEvent:ok" | 2.72.0 |
回调失败
object 类型,属性如下:
| 属性名 | 类型 | 说明 | 最低支持版本 |
|---|---|---|---|
| errMsg | string | "deleteCalendarEvent:fail"+ 详细错误信息 | 2.72.0 |
错误码
| errorCode | errMsg | errorType | 说明 | 最低支持版本 |
|---|---|---|---|---|
| 162801 | have no target event | D | 没找到对应的事件 | 2.72.0 |
| 162883 | invalid scope | D | 权限配置不正确 | 2.72.0 |
| 162883 | platform auth deny | D | 在小程序平台上不具备相应权 | 2.72.0 |
| 162899 | param title/startTime/endTime is required | D | 参数错误 请根据错误信息修改参数类型 | 2.72.0 |
扫码体验
请使用字节宿主APP扫码
代码示例
tt.deleteCalendarEvent({ title: "事件标题", startTime: new Date("2022-09-11T12:00:00").getTime() / 1000, endTime: new Date("2022-09-20T12:00:00").getTime() / 1000, success: (res) => { console.log("success", res); }, fail: (err) => { console.log("fail", err); }, });
