rails/rails — pull request #3530 by avakhov (2011-11-05 17:06:22+00:00)
Title: distance_of_time_in_words method accepts args in both directions

Method distance_of_time_in_words [date_helper.rb#L70](https://github.com/rails/rails/blob/master/actionpack/lib/action_view/helpers/date_helper.rb#L70) was designed to be symmetrical for arguments swapping. It should also work well for supporting time_ago_in_words [date_helper.rb#L132](https://github.com/rails/rails/blob/master/actionpack/lib/action_view/helpers/date_helper.rb#L132)

ae7d0d816db3f9a94008d36ab9efbe7583700981 (Take leap years into account more seriously ...) added unsymmetry for long time periods. I propose to fix it.

PS. The condtion with leap years calculation (leap_years = (fyear > tyear) ? 0 : ...) is reasonable. Although from_time will be always less or equal than to_time. fyear can be greater than tyear for example at March 1st.