0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

20240820

Posted at
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());
  }
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?