From 18c8b2112cc4554bfbc0ae119dc22fc9719df023 Mon Sep 17 00:00:00 2001 From: Maks Snegov Date: Thu, 2 May 2024 13:15:17 -0700 Subject: [PATCH] Revert "Remove operational hours" This reverts commit 425ff34ea0b3db3c3f9ade7dbd57cca40ab84e29. --- scripts/content.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/content.js b/scripts/content.js index bdfb658..6e72c94 100644 --- a/scripts/content.js +++ b/scripts/content.js @@ -382,6 +382,17 @@ async function runner() { return; } + // Check if current time is between 11pm and 9am UTC (4pm - 2am PST) + let now = new Date(); + let currentHourUTC = now.getUTCHours(); + if (currentHourUTC >= 23 || currentHourUTC < 9) { + // Continue running the code + } else { + await chrome.storage.local.set({ "ctx_statusMsg": "not operational hours" }); + isRunning = false; + return; + } + if (isFoundAppointment) { // don't do anything if appointment is found and manual booking is required if (isAppointmentPage()) {