radar / distance_of_time_in_words

Better distance of time in words for Rails
http://ryanbigg.com
MIT License
521 stars 106 forks source link

Bug in time calculation on rails version 7.1.4.1 #137

Open SweetMyCher opened 3 days ago

SweetMyCher commented 3 days ago

Strange behavior when calculating time. The bug is reproduced on rails version 7.1.4.1, ruby 3.3.4 When calling the distance_of_time((3.days + 4.hours).to_f) method, an incorrect value is displayed. As if hours are substituted for minutes: Result:"3 days and 3 hours" More examples: distance_of_time((4.days + 1.hours).to_f) Result: "4 days and 4 hours"

distance_of_time((6.days + 23.hours).to_f, locale: :en) Result: "6 days and 6 hours"

Version of gem: 5.3.3

On version rails 7.0.8.4 everything works correctly

dblock commented 3 days ago

Try adding CI on the failing version to https://github.com/radar/distance_of_time_in_words/blob/master/.github/workflows/ruby.yml and let's see if any tests fail?