async triggers for either interval or next due, accept cron

This commit is contained in:
bel
2021-07-17 23:14:54 -06:00
parent 9301ddd467
commit 8c7fe2e9ef
3 changed files with 51 additions and 9 deletions

17
server/ajax/form/cron.go Normal file
View File

@@ -0,0 +1,17 @@
package form
import (
"time"
"github.com/robfig/cron/v3"
)
type Cron string
func (c Cron) Next() time.Time {
schedule, err := cron.ParseStandard(string(c))
if err != nil {
return time.Time{}
}
return schedule.Next(time.Now())
}