HangfireIO / HangfireIO/Cronos

GetOcccurances from and to inclusive does not work

Open
#49 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.2k
Forks
137
Avg merge
5d 11h
Merged PRs (30d)
1

Description

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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.