Repository navigation
Parse cron expressions with Vixie cron's rules - #18
Merged
justintout merged 1 commit intoOct 3, 2026
Merged
Conversation
Fields are now parsed once into sets of values, shared by isValid and Cron. The parser follows Vixie cron where the old one differed: - Fields are separated by any run of spaces or tabs. - Steps are allowed inside lists: 1-10/2,20-30/5. - * may appear in a list, and names work in month lists and ranges. - Sunday is both 0 and 7: sun-sat and fri-sun are both valid. - A day field that starts with *, such as */2, is unrestricted for the day-of-month/day-of-week rule, so the two fields combine with AND.
This was referenced Oct 3, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #17. GitHub will retarget this to
mainonce #17 merges.Fields are now parsed once into sets of values.
isValidandCronshare that parse, which replaces the per-field string validators and the per-minute string matching.Changes to match Vixie cron:
1-10/2,20-30/5.*may appear in a list:*,5.jan-mar,jan,feb.sunis 0 at the start of a range and 7 at the end, sosun-satandfri-sunare both valid. A numeric5-0stays invalid.*, such as*/2, counts as unrestricted for the day rule, so the two day fields combine with AND.0 0 13 * */2now runs only on a 13th that is an even weekday.Still rejected, as in Vixie: a single value with a step (
5/2), names as steps, and empty list elements.Two fixture rows flip from invalid to valid:
1,10-15/15and1,10-12/3.