1
スクリプト時間はGMT 00現地時間はスクリプト
に設定スクリプトがユーザー
ユーザーからの日付と時刻を受け付けているアプリ日時フィールドからローカルの日付時刻を設定し、
ユーザーがクリックする。これは、それがローカル時間でトリガするように作るにはどうすればよい、GMT時間でトリガーを作成します
設定ボタン?
function onOpen() {
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.createMenu('Custom Menu').addItem('Show sidebar', 'showSidebar').addToUi();
}
function showSidebar() {
var html = HtmlService.createHtmlOutputFromFile('Sidebar').setTitle('My custom sidebar').setWidth(300);
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.showSidebar(html);
}
function sendEmail() {
GmailApp.sendEmail(Session.getEffectiveUser().getEmail(), 'Reminder C Email', 'Reminding you about...');
}
function create(AT) {
SpreadsheetApp.getUi().alert(AT)
var at = moment(AT);
ScriptApp.newTrigger('sendEmail').timeBased().at(new Date(at)).inTimezone(getDefaultUserTimeZone()).create();
}
//script timezone is GMT 00
function getDefaultUserTimeZone() {
if (CalendarApp.getDefaultCalendar()) return CalendarApp.getDefaultCalendar().getTimeZone();
else return 'Etc/GMT';
}