Repository navigation
Describe each item of a list that has a step in it - #229
Merged
bradymholt merged 2 commits intoNov 30, 2026
Merged
Conversation
A step only applies to its own list item, but */10,5 was described as "every 10,5 minutes" and steps in hour and day-of-week lists threw. Each item of such a list is now described on its own, as cRonstrue does.
bradymholt
requested changes
Nov 30, 2026
| string[] itemDescriptions = expression.Split(',') | ||
| .Select((segment, i) => | ||
| { | ||
| string itemDescription = GetSegmentDescription(segment, allDescription, getSingleItemDescription, |
Owner
There was a problem hiding this comment.
A start-offset step inside a month or year list isn't expanded to a range the way it is on its own, so 0 0 1 3/2,12 * reads "every 2 months, starting only in March and only in December" while 0 0 1 3/2 * reads "March through December". I think a test with 3/2,12 and an expanded item could cover it. WDYT?
Contributor
Author
There was a problem hiding this comment.
Good catch. The parser now expands each list item, so 3/2,12 reads "every 2 months, March through December and only in December". A DOW list with the step last (TUE,FRI/4) stays a weekly interval. Tests for 3/2,12, 1,3/4 and 0 12 10 * 3/2,1 in cd39527.
bradymholt
approved these changes
Nov 30, 2026
|
The changes in PR were just released in 3.6.0 🎉. |
This was referenced Nov 30, 2026
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.
What changed and why
A step only applies to its own list item (
*/10,5is every 10 minutes, plus minute 5), but the descriptor took the whole list as the step value:*/10,5 * * * *0-30/10,45 * * * *0 */6,1 * * *0 0 */5,3 * *0 0 1 */3,2 *0 12 * * 1-5/2,60 12 * * MON,*/20 12 10 * */2,1Each item of a list that has a step in it is now described on its own, the way cRonstrue does it. Lists without a step, and the existing weekly reading of
TUE,FRI/4, are unchanged.0inside such a list (*/10,0) is spelled out instead of an empty item that left a trailing "and".*; those were the FormatExceptions.I compared 30 locales x 187 expressions (lists, ranges and steps in every field, with and without day of month, 12/24h and verbose) before and after: only lists containing a step changed.
Checklist
dotnet test test/Test.csprojpasses (1599 passed, 11 skipped)TestListWithStepItem,TestDayOfWeekListWithStepItem, both fail before the change)<Description>(see CONTRIBUTING.md)