所以我希望我的插件在它的函数中使用用户时区,我如何在清单中设置它?
{
"oauthScopes": [
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.send",
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/script.container.ui",
"https://www.googleapis.com/auth/script.scriptapp",
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/script.storage"
],
"dependencies": {
},
"exceptionLogging": "STACKDRIVER",
"timeZone": "GMT"
}我的意思是addon可能会被来自美国或印度的用户使用,他们应该根据自己的时区运行addon。
发布于 2018-09-18 14:04:56
您只需要在清单文件中使用以下作用域来检索用户的时区。
https://www.googleapis.com/auth/spreadsheets然后使用SpreadsheetApp服务获取当前电子表格的默认时区,该时区很可能也是用户的时区。
var ss = SpreadsheetApp.getActiveSpreadsheet();
Logger.log(ss. getSpreadsheetTimeZone());https://stackoverflow.com/questions/52374909
复制相似问题