We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following produces an incorrect last time:
cron_parser = CronParser.new('* * * * *') p "Now: #{Time.now}" p "Last: #{cron_parser.last}" p "Next: #{cron_parser.next}"
The output is
"Now: 2014-05-12 13:15:42 -0600" "Last: 2014-05-12 13:14:00 -0600" "Next: 2014-05-12 13:16:00 -0600"
But would expect the output to be (notice 13:15:00 in the "Last:" line)
"Now: 2014-05-12 13:15:42 -0600" "Last: 2014-05-12 13:15:00 -0600" "Next: 2014-05-12 13:16:00 -0600"
The text was updated successfully, but these errors were encountered:
I had this same issue and I fixed it with the following diff. From what I can tell it works fine.
--- a/lib/cron_parser.rb +++ b/lib/cron_parser.rb @@ -126,7 +126,10 @@ class CronParser end # always nudge the minute - nudge_minute(t, :last) + unless time_specs[:minute][0].include?(t.min) + nudge_minute(t, :last) + end + t.to_time t = t.to_time if num > 1
Sorry, something went wrong.
Don't always nudge the minute
2117b04
siebertm#17 (comment)
Fixed in pull request #38
No branches or pull requests
The following produces an incorrect last time:
The output is
But would expect the output to be (notice 13:15:00 in the "Last:" line)
The text was updated successfully, but these errors were encountered: