robfig/cron

【Question】cron Not support DayOfWeek 'L'

whillt opened this issue · 2 comments

in old version: github.com/robfig/cron v1.2.0

use expression:
p, err := cron.Parse("0 20 14 ? * 5L")
occur error: strconv.Atoi: parsing "5L": invalid syntax

so upgrade new version:github.com/robfig/cron/v3 v3.0.0
use expression:
subsParser := cron.NewParser(cron.Second | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow) sched, err := subsParser.Parse("0 20 14 ? * 5L")

still have errors :failed to parse int from 5L: strconv.Atoi: parsing "5L": invalid syntax

Looking forward to your reply thank you

I read the source code and found that L is not a standard cron character. Is there any alternative?

rissw commented

you can try using #325