jmrozanec/cron-utils

DOM list including "L" does not behave as expected

kristofarkas opened this issue · 6 comments

A cron expression for every 15th and last day of the month at 12:00 does not behave as expected and skips the last days when asked for next execution time.

Example cron schedule: 0 0 L,15 * *

While the cron expression is "valid" I wonder if this is in fact not supported.

@kristofarkas, thank you for reporting this. May we ask you for a PR with a test reproducing the issue? Thanks! 😄

(just a lurker, not part of the project, just trying to help)

"valid" I wonder if this is in fact not supported.

The README for this project says:

Non-standard characters L, W, LW, '?' and # are supported as well!

so I think the intent is for L to be supported.

When using the ‘L’ option, it is important not to specify lists, or ranges of values, as you’ll get confusing/unexpected results.

This quote is from the quarz cron tutorial here: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html. Is L,15 a list? And if so does it fall under the this quote?

Any thoughts on this @jmrozanec? I could contribute a fix (if this is indeed a bug) with some help from you on where to look.

@kristofarkas, if the expression is valid, it must be supported as defined in the specification. We will be glad to merge a PR with a valid fix 😄 Thanks!