You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If containing a "day of week" part, the expression is not satisfied by a timestamp that should satisfy it. On the other hand, the same timestamp satisfies expressions with specific "day of week" part, that should not be satisfied by it. The GetNextValidTimeAfter method return a timestamp that should not satisfy the pattern, but it does.
Version used
3.8.0
To Reproduce
var dto = DateTimeOffset.Parse("2024.02.06 09:35:00");
Console.WriteLine(dto.ToString("dddd")); // yields: Tuesday
var co2 = new CronExpression("0 35 09 ? * 2");
Console.WriteLine(co2.IsSatisfiedBy(dto)); // yields: FALSE, but is should return TRUE
var next = co2.GetNextValidTimeAfter(dto); // it should give a date that is Tuesday
Console.WriteLine(next.Value.ToString("dddd")); // yieldy: Monday
Console.WriteLine(co2.IsSatisfiedBy(next.Value)); // yields: TRUE, should return FALSE
var co3 = new CronExpression("0 35 09 ? * 3"); // note: should match Wednesday only
Console.WriteLine(co3.IsSatisfiedBy(dto)); // yields: TRUE, should return FALSE
var co4 = new CronExpression("0 35 09 ? * 1"); // note: should match Monday only
Console.WriteLine(co4.IsSatisfiedBy(next.Value)); // yields: FALSE, although that's a Monday
Expected behavior
The pattern should be satisfied by dates that are on the proper days of the week. The next valid date should also match the pattern.
The text was updated successfully, but these errors were encountered:
Describe the bug
If containing a "day of week" part, the expression is not satisfied by a timestamp that should satisfy it. On the other hand, the same timestamp satisfies expressions with specific "day of week" part, that should not be satisfied by it. The
GetNextValidTimeAfter
method return a timestamp that should not satisfy the pattern, but it does.Version used
3.8.0
To Reproduce
Expected behavior
The pattern should be satisfied by dates that are on the proper days of the week. The next valid date should also match the pattern.
The text was updated successfully, but these errors were encountered: