Created
June 26, 2023 05:15
-
-
Save ochilab/2be8353bc4fff3e932eae54d7b091cf7 to your computer and use it in GitHub Desktop.
GAS:Google Calendarの終日イベントを別のカレンダーに移動する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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