either of cron or loop can be set and unset, mark invalids as invalid and unfinish

This commit is contained in:
bel
2021-07-17 23:58:51 -06:00
parent f84614a8da
commit 2763b68bc4
2 changed files with 22 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
package form
import (
"log"
"time"
"github.com/robfig/cron/v3"
@@ -11,6 +12,7 @@ type Cron string
func (c Cron) Next(since time.Time) time.Time {
schedule, err := cron.ParseStandard(string(c))
if err != nil {
log.Printf("failed to parse cron %q: %v", string(c), err)
return time.Time{}
}
return schedule.Next(since)