Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CronExpresion monthly and weekdayonly skips the month when on day of Saturday #2331

Open
lynnz11 opened this issue Apr 22, 2024 · 1 comment

Comments

@lynnz11
Copy link

lynnz11 commented Apr 22, 2024

Describe the bug

Set CronExpression of weekdayonly with a certain day, e.g. 15W. The month will be skipped if the specified day is Saturday.

Version used

3.8.1

To Reproduce

[Test]
public void TestCronExpression()
{
CronExpression cronExpression = new CronExpression("0 0 12 15W * ?");
DateTimeOffset? nextFireTime = cronExpression.GetTimeAfter((DateTimeOffset) new DateTime(2024, 5, 15, 12, 0, 0).ToUniversalTime());
Assert.IsTrue(nextFireTime.Value.Month == 6, $"CronExpression failed");
}
Result is 7/15/2024

Expected behavior

6/14/2024

Additional context

@lynnz11
Copy link
Author

lynnz11 commented Apr 24, 2024

Version used is 4.0.0.0

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

No branches or pull requests

1 participant