From 90fc62ba6e62952df71120ad2a4f2dfdd513da49 Mon Sep 17 00:00:00 2001 From: Leo <5376265+leoherzog@users.noreply.github.com> Date: Thu, 24 Mar 2022 19:01:07 +0000 Subject: [PATCH] Bump Version --- src/Code.gs | 16 ++++++++-------- src/index.html | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Code.gs b/src/Code.gs index 7688bb3..7b4f352 100644 --- a/src/Code.gs +++ b/src/Code.gs @@ -158,9 +158,9 @@ function testGetSuggestedTimes() { console.log(JSON.stringify(getSuggestedTimes('primary', 'schuitema@hope.edu', '30', '900', '09:00', '17:00', [0, 6], '240', '60'), null, 2)) } -function getSuggestedTimes(myid, theirid, length, step, timeMin, timeMax, daysToExclude, minMinutesFromNow, maxDaysFromNow) { +function getSuggestedTimes(myId, theirId, length, step, timeMin, timeMax, daysToExclude, minMinutesFromNow, maxDaysFromNow) { - if (!theirid || !/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(theirid)) throw 'Invalid email'; // emailregex.com + if (!theirId || !/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(theirId)) throw 'Invalid email'; // emailregex.com if (!length) throw 'Length is not a valid number'; if (typeof length !== "number") { @@ -203,12 +203,12 @@ function getSuggestedTimes(myid, theirid, length, step, timeMin, timeMax, daysTo "timeMax": max.toISO(), "timeZone": myTimezone, "items": [ - {"id": myid}, - {"id": theirid} + {"id": myId}, + {"id": theirId} ] }); - if (!freeBusy['calendars'][theirid] || freeBusy['calendars'][theirid]['errors']) throw 'Problem fetching freebusy: ' + JSON.stringify(freeBusy['calendars'][theirid]['errors']); + if (!freeBusy['calendars'][theirId] || freeBusy['calendars'][theirId]['errors']) throw 'Problem fetching freebusy: ' + JSON.stringify(freeBusy['calendars'][theirId]['errors']); let suggestions = []; @@ -227,8 +227,8 @@ function getSuggestedTimes(myid, theirid, length, step, timeMin, timeMax, daysTo if (daysToExclude.includes(nextStep.weekday === 7 ? 0 : nextStep.weekday)) continue; // occurs on day to exclude. luxon sunday is 7, not 0 let timerange = luxon.Interval.fromDateTimes(nextStep, end); - if (freeBusy['calendars'][myid]['busy'].some(busy => timerange.overlaps(luxon.Interval.fromISO(busy['start'] + '/' + busy['end'])))) continue; // busy on mine - if (freeBusy['calendars'][theirid]['busy'].some(busy => timerange.overlaps(luxon.Interval.fromISO(busy['start'] + '/' + busy['end'])))) continue; // busy on theirs + if (freeBusy['calendars'][myId]['busy'].some(busy => timerange.overlaps(luxon.Interval.fromISO(busy['start'] + '/' + busy['end'])))) continue; // busy on mine + if (freeBusy['calendars'][theirId]['busy'].some(busy => timerange.overlaps(luxon.Interval.fromISO(busy['start'] + '/' + busy['end'])))) continue; // busy on theirs suggestions.push(nextStep); @@ -287,7 +287,7 @@ function getLuxon_() { } function checkGithubReleaseVersion_() { - let currentVersion = 'v0.1.1'; + let currentVersion = 'v0.1.2'; let latestRelease; try { latestRelease = JSON.parse(UrlFetchApp.fetch('https://api.github.com/repos/leoherzog/ScheduleQuest/releases/latest').getContentText()); diff --git a/src/index.html b/src/index.html index 4fc16be..b7bd5ab 100644 --- a/src/index.html +++ b/src/index.html @@ -425,7 +425,7 @@

$('#seeEvent').style.display = 'inline'; $('#seeEvent').href = details.htmlLink; $('dialog')[0].setAttribute('open', true); - toggleMeetingType(meetingTypes[$('#typetitle').dataset.type]); + toggleMeetingType(meetingTypes[$('#typetitle').dataset.type]); // clear and reset form } function errorScheduling(error) {