This project is archived and is in readonly mode.
distance_of_time_in_words calculates wrong no of years
Reported by Hexagon | November 27th, 2010 @ 11:01 AM | in 3.0.6
https://github.com/rails/rails/blob/master/actionpack/lib/action_vi...
remainder = ((distance_in_minutes - minute_offset_for_leap_year) % 525600)
minute_offset_for_leap_year should be added to distance_in_minutes, not subtracted. This causes distance_of_time_in_words to return a full year too much in certain conditions.
Comments and changes to this ticket
-
Aditya Sanghi November 27th, 2010 @ 06:47 PM
- State changed from new to open
- Milestone cleared.
- Assigned user set to Aditya Sanghi
- Tag set to actionview
- Importance changed from to Low
working on failing test and once done will patch.
-
Aditya Sanghi November 27th, 2010 @ 09:35 PM
- Assigned user cleared.
-
Aditya Sanghi November 29th, 2010 @ 03:17 PM
- Assigned user set to José Valim
- Tag changed from actionview to actionview, patch
Actually the subtraction makes sense here. The problems is that distance_in_year does not take care of the leap years properly when finding the distance in years.
Adding patch + test
-
Santiago Pastorino February 27th, 2011 @ 03:15 AM
- Milestone changed from 3.0.5 to 3.0.6
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>