From 875d04cb0df2daf5b8ea677eb0d17ea4d0b116a0 Mon Sep 17 00:00:00 2001 From: Chanel Greco Date: Tue, 16 Jan 2024 16:48:44 +0100 Subject: [PATCH] Changed the blockOutCalendar function synce OOO events are new supported by the Calendar API. --- solutions/ooo-chat-app/Code.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/solutions/ooo-chat-app/Code.js b/solutions/ooo-chat-app/Code.js index da6f54b70..6a0316267 100644 --- a/solutions/ooo-chat-app/Code.js +++ b/solutions/ooo-chat-app/Code.js @@ -132,19 +132,17 @@ function setAutoReply() { } -const ONE_DAY_MILLIS = 24 * 60 * 60 * 1000; /** * Creates an out of office event in the user's Calendar. */ function blockOutCalendar() { - -/** - * Helper function to get a the current date and set the time for the start and end of the event. - * @param {number} hour The hour of the day for the new date. - * @param {number} minutes The minutes of the day for the new date. - * @return {Date} The new date. - */ + /** + * Helper function to get a the current date and set the time for the start and end of the event. + * @param {number} hour The hour of the day for the new date. + * @param {number} minutes The minutes of the day for the new date. + * @return {Date} The new date. + */ function getDateAndHours(hour, minutes) { const date = new Date(); date.setHours(hour); @@ -170,7 +168,6 @@ function blockOutCalendar() { /** * Declines all meetings for the day. */ - function cancelMeetings() { const events = CalendarApp.getEventsForDay(new Date()); @@ -185,6 +182,7 @@ function cancelMeetings() { * Turns on the user's vacation response for today in Gmail. */ function turnOnAutoResponder() { + const ONE_DAY_MILLIS = 24 * 60 * 60 * 1000; const currentTime = (new Date()).getTime(); Gmail.Users.Settings.updateVacation({ enableAutoReply: true,