Closed davilavillalobosa closed 1 year ago
Hi @davilavillalobosa!
But the second cron expression '0 0 0 1 8/6 ?' exceeds the maximal value (8 + 6 > 12) and therefore returns an unexpected value.
Currently it's expected behaviour. 8/6
will be expanded to 8 - 12
(and 2/6
will be expanded to 2 - 12
and matches 2,8
) and matches 8
only as this is in the range. It's also non-standard way to use repeats, but if you check it against some other implementation (https://crontab.guru for example), it behaves the same.
Relates to this: https://github.com/harrisiirak/cron-parser/issues/156
When the step size plus the starting point is greater than the maximal expected value, then the next or prev function will return unexpected values.
Regardless of the starting point, I would expect the following cron expressions to be equal given the same current date.
In the example, the maximal month is 12. The first cron expression
'0 0 0 1 2/6 ?'
returns the expected prev and next dates. But the second cron expression'0 0 0 1 8/6 ?'
exceeds the maximal value (8 + 6 > 12) and therefore returns an unexpected value.Steps to Reproduce
Result
The same issue can also be reproduced with the following cron expressions '0 10/20 ?', '0 50/20 ?'
I'm currently reducing the month size with the following function:
Is this a bug?