Skip to content

Commit 6ed009b

Browse files
Copilotbradymholt
andauthored
Fix */7 day-of-week step value parsing bug (#191)
* Initial plan * Initial analysis: Identify issue with */7 cron expression parsing Co-authored-by: bradymholt <[email protected]> * Fix */7 day-of-week step value parsing bug Co-authored-by: bradymholt <[email protected]> * Rever back to net6.0 --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: bradymholt <[email protected]> Co-authored-by: Brady Holt <[email protected]>
1 parent 6f5f38f commit 6ed009b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/ExpressionDescriptor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ Func<string, string> getRangeFormat
580580
else if (expression.Contains("/"))
581581
{
582582
string[] segments = expression.Split('/');
583-
description = string.Format(getIntervalDescriptionFormat(segments[1]), getSingleItemDescription(segments[1]));
583+
description = string.Format(getIntervalDescriptionFormat(segments[1]), segments[1]);
584584

585585
//interval contains 'between' piece (i.e. 2-59/3 )
586586
if (segments[0].Contains("-"))

test/TestFormats.en.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,13 @@ public void TestsEvery3DayOfTheWeek()
367367
Assert.Equal("At 10:15 AM, every 3 days of the week", GetDescription("0 15 10 ? * */3"));
368368
}
369369

370+
[Fact]
371+
public void TestsEvery7DayOfTheWeek()
372+
{
373+
// GitHub Issue #188: https://github.com/bradymholt/cron-expression-descriptor/issues/188
374+
Assert.Equal("Every hour, every 7 days of the week", GetDescription("0 * * * */7"));
375+
}
376+
370377
[Fact]
371378
public void TestEvery2DayOfTheWeekInRange()
372379
{

0 commit comments

Comments
 (0)