-
Notifications
You must be signed in to change notification settings - Fork 215
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
The method from_now of Class: BusinessTime::BusinessDays returns different results under the same context #221
Comments
What version of Ruby are you using? |
3.0.5 |
I have not been able to reproduce this yet: >> RUBY_VERSION
=> "3.0.5"
?> def run
?> 50.times { |i| puts "500.business_days.from_now#{i}: #{500.business_days.from_now}" }
>> end
=> :run
>> run
500.business_days.from_now0: 2024-12-02 09:00:00 -0700
# (... all the same)
500.business_days.from_now49: 2024-12-02 09:00:00 -0700
=> 50 What kind of holiday and/or other configuration are you using? |
If I run the line But if I just randomly put the line into a method in the code which is triggered in a cucumber test scenario, then I can reproduce the effect: |
@rmm5t is there any update on the issue? the bug is still present |
No updates. Again, What kind of holiday and/or other configuration are you using? There’s not much I can do here without a way to reproduce this. If you can submit a PR with a test that exhibits the behavior that you’re seeing, that would go a long way. |
The Method from_now of Class: BusinessTime::BusinessDays is used to calculate a specific date in a Ruby on Rails application. Sometimes (only sometimes!) wrong date was delivered back at a specific point. I just could not find out what the problem is, until I placed the following lines into my code, just for the sake of experiementing:
This is the screenshot, what was returned on the console:
Here is a content of the console as text:
As you see, sometimes the Date 2024-11-29 is returned but sometimes 2024-12-30.
This might be a bug, or something I do not understand.
The text was updated successfully, but these errors were encountered: