function listTomorrowEvents() {
// 明日の日付を取得
var now = new Date();
var tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);
var dayAfterTomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 2);
// カレンダーの予定を取得
var calendar = CalendarApp.getDefaultCalendar();
var events = calendar.getEvents(tomorrow, dayAfterTomorrow);
if (events.length === 0) {
Logger.log('明日の予定はありません。');
return;
}
// 取得した予定の情報を表示
for (var i = 0; i < events.length; i++) {
var event = events[i];
Logger.log('タイトル: ' + event.getTitle());
Logger.log('作成日: ' + event.getDateCreated());
}
}
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme