Skip to content

Instantly share code, notes, and snippets.

@ochilab
Created June 26, 2023 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ochilab/2be8353bc4fff3e932eae54d7b091cf7 to your computer and use it in GitHub Desktop.
Save ochilab/2be8353bc4fff3e932eae54d7b091cf7 to your computer and use it in GitHub Desktop.
GAS:Google Calendarの終日イベントを別のカレンダーに移動する
function moveGCalEvent(event,targetCalendarId) {
var targetCalendar = CalendarApp.getCalendarById(targetCalendarId);
// イベントの詳細を取得
var eventTitle= event.getTitle();
var date =event.getAllDayStartDate(); //終日イベントが対象
// 新しいカレンダーに同じイベントを作成
var newEvent = targetCalendar.createAllDayEvent(eventTitle,date);
// 元のカレンダーから旧イベントを削除
event.deleteEvent();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment