either of cron or loop can be set and unset, mark invalids as invalid and unfinish
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user