Skip to content

feat: accept every/the prefixes on ordinal weekdays#8

Merged
merencia merged 1 commit into
masterfrom
fix-ordinal-prefix
Jun 23, 2026
Merged

feat: accept every/the prefixes on ordinal weekdays#8
merencia merged 1 commit into
masterfrom
fix-ordinal-prefix

Conversation

@merencia

Copy link
Copy Markdown
Member

every last monday of the month and the last monday of the month previously threw a CronTranslateError, even though the bare last monday of the month worked. The every / the prefixes are natural phrasings, so this was a usability gap, not a deliberate scope cut.

Fix

parseEvery and the the-clause now delegate to the ordinal-weekday handler when they see an ordinal word followed by a weekday (or last day):

Input Cron
every last monday of the month 0 0 0 * * 1L
the last monday of the month 0 0 0 * * 1L
every first monday of the month 0 0 0 * * 1#1
every second tuesday of the month 0 0 0 * * 2#2
every last day of the month 0 0 0 L * *

every second stays the unit (the ordinal path requires a following weekday).

Checks

  • typecheck, lint, build clean; 148 tests green (6 new golden cases). README note added.

"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.
@merencia merencia force-pushed the fix-ordinal-prefix branch from bb694a0 to 0c600be Compare June 23, 2026 13:05
@merencia merencia changed the title Accept every/the prefixes on ordinal weekdays feat: accept every/the prefixes on ordinal weekdays Jun 23, 2026
@merencia merencia merged commit 2522f5d into master Jun 23, 2026
5 checks passed
@merencia merencia deleted the fix-ordinal-prefix branch June 23, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant