Closed Tochemey closed 1 year ago
@JohnRoesler This is an example:
var cronExpressionParser = cron.NewParser(
cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor,
)
cronExpression := "0 0 0 4 JUL ? 2014"
spec, err := cronExpressionParser.Parse(cronExpression)
and this the outcome:
expected 5 to 6 fields, found 7: [0 0 0 4 JUL ? 2014]
However this 0 0 0 4 JUL ? 2014
is valid cron expression
Hey @Tochemey,
Couple things:
Although, note that the year field (optional in Quartz) is not supported.
What are you trying to accomplish? I imagine there are other ways to achieve it without the year field?
To answer the title question: no, no plans. Cheers!
@JohnRoesler Thanks for the reply.
@JohnRoesler even on Wikipedia the Cron expression does accept year field. It just not required. https://en.m.wikipedia.org/w/index.php?title=Cron&action=edit§ion=9
Is your feature request related to a problem? Please describe
The standard cron expression does accept year field. This for instance helps to schedule tasks to run only once.
From the code I cannot see anything that will help handle that. That means a cron expression like this
0 0 0 4 JUL ? 2014
will fail the parser because I have seen that there is validation done on the cron expression.reference: https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm