feat: accept every/the prefixes on ordinal weekdays#8
Merged
Conversation
"every last monday of the month" and "the last monday of the month" previously threw, because parseEvery and the the-clause only handled the bare ordinal form. Both now delegate to the ordinal-weekday handler and produce the same 1L / 1#1 / L. "every second" stays the unit: the ordinal path requires a following weekday.
bb694a0 to
0c600be
Compare
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.
every last monday of the monthandthe last monday of the monthpreviously threw aCronTranslateError, even though the barelast monday of the monthworked. Theevery/theprefixes are natural phrasings, so this was a usability gap, not a deliberate scope cut.Fix
parseEveryand thethe-clause now delegate to the ordinal-weekday handler when they see an ordinal word followed by a weekday (orlast day):every last monday of the month0 0 0 * * 1Lthe last monday of the month0 0 0 * * 1Levery first monday of the month0 0 0 * * 1#1every second tuesday of the month0 0 0 * * 2#2every last day of the month0 0 0 L * *every secondstays the unit (the ordinal path requires a following weekday).Checks