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

GetOcccurances from and to inclusive does not work #49

Open
Simon-Sandrew opened this issue May 31, 2022 · 1 comment
Open

GetOcccurances from and to inclusive does not work #49

Simon-Sandrew opened this issue May 31, 2022 · 1 comment

Comments

@Simon-Sandrew
Copy link

Simon-Sandrew commented May 31, 2022

Hi!

Could be me misunderstanding something, but im getting different results with the following call:

DateTime startTime = {'5/20/2022 12:00:00 AM' }; //obv as a DateTime object
DateTime endTime= {'5/31/2022 12:00:00 AM' }; // obv as a DateTime object
string expression = '0 0 9 * * 1,2,3,4,5';
var cron = cronExpression.Parse(expression , CronFormat.IncludeSeconds);
cronExpression.GetOccurances(startTime, endTime, true, true).
this returns, as expected the following:
5/20/2022 9:00
5/23/2022 9:00
5/24/2022 9:00
5/25/2022 9:00
5/26/2022 9:00
5/27/2022 9:00
5/30/2022 9:00

however, changing the expression to the following
string expression = '0 0 0 * * 1,2,3,4,5';

removes 5/20 from the list, despite it being the exact same call?

I could theoretically move the input times back by a second, but that's a hacky fix id rather not do.

Again, not sure if this is expected behavior, or if I'm just being dumb. Let me know if you can help. Thanks!

@FaithfulDev
Copy link
Contributor

@Simon-Sandrew Good news, I just tested your issues with the current version and it now works as expected. You didn't mention what version you are using, so I can't verify the original issue. Maybe you could test it again and report back if this issue is resolved for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants