From 57239561f7dca0444911c571f3c6afad3b82e3ba Mon Sep 17 00:00:00 2001 From: Josh Guyette Date: Mon, 17 Jul 2023 18:09:45 -0500 Subject: [PATCH] version 1.0.5 --- src/Scheduler.ts | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/Scheduler.ts b/src/Scheduler.ts index 2359f30..82176de 100644 --- a/src/Scheduler.ts +++ b/src/Scheduler.ts @@ -36,19 +36,17 @@ export class Scheduler { let now = new Date() // set the target time - let targetTime = ( - !start.timeOfDay - ? start.date - : new Date( - now.getFullYear(), - now.getMonth(), - now.getDate(), - start.timeOfDay.hour, - start.timeOfDay.minute ?? 0, - start.timeOfDay.seconds ?? 0, - 0 - ) - )! + const targetTime = start.timeOfDay + ? new Date( + now.getFullYear(), + now.getMonth(), + now.getDate(), + start.timeOfDay.hour, + start.timeOfDay.minute ?? 0, + start.timeOfDay.seconds ?? 0, + 0 + ) + : start.date ?? now // if the target time has already passed today, set it for tomorrow if (start.timeOfDay && now > targetTime) {