【发布时间】:2018-11-22 07:13:52
【问题描述】:
我想执行一项功能,该功能允许我仅查询具有特定字符(即“#”)的谷歌日历。
我知道函数 CalendarApp.getCalendarsByName 返回一个日历数组,所以我希望我可以使用这个函数和通配符来返回我想要的日历。我从这里得到了一些关于使用通配符的建议 https://productforums.google.com/forum/#!topic/calendar/gmf6ewpjH4g/
这是目前为止的代码:
function Test() {
var pattern = /.*#.*/;
var calendarsz = CalendarApp.getCalendarsByName(pattern);
Logger.log('Found %s matching calendars.', calendarsz.length);
};
但它根本没有返回任何日历。任何有关如何在此函数中使用通配符的建议,或仅返回具有特定字符的日历的替代方法,我们将不胜感激。
【问题讨论】:
标签: google-apps-script google-api google-calendar-api wildcard