This project is archived and is in readonly mode.

#4919 ✓stale

distance_of_time_in_words should work with DateTime as argument

Reported by yannick | June 21st, 2010 @ 11:07 AM | in 3.x

distance_of_time_in_words should work with DateTime as argument

due to this bug:

since the rationale is in fraction of days and not in seconds!

simple solution attached.

Comments and changes to this ticket

  • Bruno Michel

    Bruno Michel June 29th, 2010 @ 09:56 PM

    I don't see the problem on distance_of_time_in_words. Can you add a test in your patch to show it?

  • yannick

    yannick July 8th, 2010 @ 03:38 PM

    i think it is clear, that if the calculation unit changes it will not work as expected. Time is in seconds, DateTime in days.

    if DateTime.to_time does not return a time result you get unexpected behaviour.

    thus, if #1713 is a wontfix you get inconsistent behavior until you make sure the calculation unit is as expected.

  • rails

    rails March 5th, 2011 @ 12:00 AM

    • State changed from “new” to “open”

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • rails

    rails March 5th, 2011 @ 12:00 AM

    • State changed from “open” to “stale”
  • Dan Pickett

    Dan Pickett March 13th, 2011 @ 05:27 PM

    • Tag changed from datetime time date to datetime, distance_of_time_in_words
    • Milestone set to 3.x
    • Assigned user set to “Dan Pickett”
    • Importance changed from “” to “Low”

    applying this patch causes 3 test failures in actionpack master. Can you fix the patch to include a failing test case without your change and fixes to remedy the test failures?

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=""></a>