V0.1 release #11

Merged
kelly merged 19 commits from v0.1 into main 2026-06-02 20:49:08 -05:00
Showing only changes of commit adf42df4a7 - Show all commits
+11 -1
View File
@@ -105,17 +105,27 @@ while ($true) {
} }
Write-Host "Finding next notification time..." Write-Host "Finding next notification time..."
$nextNotificationTomorrow = $true
foreach($time in $notificationTimes) foreach($time in $notificationTimes)
{ {
$now = Get-Date $now = Get-Date
$diff = $now.Hour - $time $diff = $now.Hour - $time
if ($diff -lt 0) # next notification time if ($diff -lt 0) # next notification time
{ {
$nextNotificationTomorrow = $false
Write-Host "Next notification time is $time`:00" Write-Host "Next notification time is $time`:00"
$sleepTime = ($diff * -1) * 60 $sleepTime = ($diff * -1) * 60 * 60 # hours * mins * seconds
Write-Host "Sleeping for $sleepTime seconds" Write-Host "Sleeping for $sleepTime seconds"
Start-Sleep -Seconds $sleepTime Start-Sleep -Seconds $sleepTime
continue # leave loop continue # leave loop
} }
} }
if ($nextNotificationTomorrow)
{
Write-Host "Next notification time is $time`:00"
$diff = 24 - $now.Hour + $notificationTimes[0]
$sleepTime = $diff * 60 * 60 # hours * mins * seconds
Write-Host "Sleeping for $sleepTime seconds"
Start-Sleep -Seconds $sleepTime
}
} }