google 日历无法按 ID 删除活动
google calendar unable to delete event by id
所以我有一个创建事件的应用程序脚本代码:
var cal = CalendarApp.getCalendarById(calendarId);
var start = new Date(startDt);
var end = new Date(endDt);
var event = cal.createEvent(title, start, end, {
description : desc,
});
它工作正常,在它创建事件后,我使用
event.getId()
记录事件 ID
当我 运行 以下代码使用我记录的 ID 删除事件时,它告诉我该事件不存在。
var cal = CalendarApp.getCalendarById(calendarId);
var event = cal.getEventSeriesById(evc2);
event.deleteEventSeries();
return;
为什么找不到活动?
我用来记录事件 ID 的代码不正确吗?
或者我尝试删除事件的方式不正确?
所以代码在我 运行 单独运行时有效,所以问题出在其他地方。
在做了一些清理并删除未使用的变量之后,它又开始工作了。我无法弄清楚问题出在哪里,但它现在正在工作,感谢您的投入
所以我有一个创建事件的应用程序脚本代码:
var cal = CalendarApp.getCalendarById(calendarId);
var start = new Date(startDt);
var end = new Date(endDt);
var event = cal.createEvent(title, start, end, {
description : desc,
});
它工作正常,在它创建事件后,我使用
event.getId()
记录事件 ID
当我 运行 以下代码使用我记录的 ID 删除事件时,它告诉我该事件不存在。
var cal = CalendarApp.getCalendarById(calendarId);
var event = cal.getEventSeriesById(evc2);
event.deleteEventSeries();
return;
为什么找不到活动?
我用来记录事件 ID 的代码不正确吗?
或者我尝试删除事件的方式不正确?
所以代码在我 运行 单独运行时有效,所以问题出在其他地方。 在做了一些清理并删除未使用的变量之后,它又开始工作了。我无法弄清楚问题出在哪里,但它现在正在工作,感谢您的投入