Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

distance_of_time_in_words calculates wrong no of years

#6074

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.

Origin:
http://bugs.joindiaspora.com/issues/599

Reported by Hexagon · November 27th, 2010 @ 11:01 AM

State: open
Milestone: 3.0.6
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Aditya Sanghi
    Aditya Sanghi
    • 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.

    November 27th, 2010 @ 06:47 PM

  2. Aditya Sanghi
  3. Aditya Sanghi
    Aditya Sanghi
    • 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

    November 29th, 2010 @ 03:17 PM

  4. Aditya Sanghi
    Aditya Sanghi

    bump! any thoughts on this?

    December 22nd, 2010 @ 04:55 PM

  5. Santiago Pastorino
  6. Santiago Pastorino
    Santiago Pastorino
    • Milestone changed from 3.0.5 to 3.0.6

    February 27th, 2011 @ 03:15 AM