Open bahmanrafatjoo opened 2 years ago
Looks like there's a bug with handing cronspecs with some 31-day months. The tests don't fail for every 31-day month but where they do the failure is different depending on the input. I'm fairly sure I've the correct input format.
check_next("0 25 23 31 10 ?", "2011-09-22 14:20:00", "2011-10-31 23:25:00");
check_next("0 25 23 31 7 ?", "2011-09-22 14:20:00", "2012-07-31 23:25:00");
check_next("0 25 23 31 8 ?", "2011-09-22 14:20:00", "2012-08-31 23:25:00");
I'll try and go through the code to see if I can identify the cause but thought I'd post this in case some wiser heads can assist.
I have a proposed fix which I'll submit as a PR.
Looks like there's a bug with handing cronspecs with some 31-day months. The tests don't fail for every 31-day month but where they do the failure is different depending on the input. I'm fairly sure I've the correct input format.
Passing test:
check_next("0 25 23 31 10 ?", "2011-09-22 14:20:00", "2011-10-31 23:25:00");
Failing test 1:
check_next("0 25 23 31 7 ?", "2011-09-22 14:20:00", "2012-07-31 23:25:00");
Failing test 2:
check_next("0 25 23 31 8 ?", "2011-09-22 14:20:00", "2012-08-31 23:25:00");
I'll try and go through the code to see if I can identify the cause but thought I'd post this in case some wiser heads can assist.