-
Notifications
You must be signed in to change notification settings - Fork 34
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
weekday cron does not run today when started before execution time #52
Comments
it "calculates weekdays correctly when starting at the same day" do
Time.stubs(:now).returns(Time.parse("2021-02-02 00:00:00")) # tuesday morning
Fugit.do_parse_cron("59 23 * * 2").next_time.to_s.must_equal "2021-02-02 23:59:00 -0000"
end since 2021-02-02 is a Tuesday. |
The spec you gave me, when adapted, goes green. OK, if I look at the initial problem explanation, 2021-02-09 is the second Tuesday of the month, not the first. So I think that fugit is right. At 2021-02-09 17:41:10, given "55 18 * * 2#1", the next first Tuesday of the month at 18:55 is "2021-03-02 18:55". Did I misunderstand you? |
my initial case was second tuesday, I tried to dumb it down to make the spec simpler 🤦 2021-02-09 17:41:10 + "55 18 * * 2#1", should come out as is "2021-02-09 18:55" since it is currently the second Tuesday and not yet 18:55 |
No, "2#1" means "first Tuesday of the month", not "second Tuesday of the month". |
yeah you are correct ... so something happened on the first tuesday and I though it was supposed to come today ... thx for looking into it, sorry for the noise 😞 |
fugit 1.4.2
the second Tuesday of the week was today, we started the cron earlier today, but it never executed, because it thinks the next execution is next month and not today ... so seems like the weekday calculation needs to take time of day into account
The text was updated successfully, but these errors were encountered: