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.

Fix Documentation of to_formatted_s and give love to seconds

#5792

Documentation of the to_formatted_s in activesupport/lib/core_ext/time/conversions.rb is wrong. It shows the output of to_s(:time) as "06:10:17" when in fact it only returns "06:10".

Which leads me to say that in fact the output is something useful and there should be a default format for that. I've included :time_with_seconds as a default time format which does return "06:10:17" (tests incldued).

Reported by Aditya Sanghi · October 12th, 2010 @ 09:17 AM

State: stale
Milestone: 3.x
Assigned to: Xavier Noria Xavier Noria
Importance: Low

Activity

  1. Aditya Sanghi
    Aditya Sanghi
    • Assigned user changed from Prem Sichanugrist (sikachu) to Xavier Noria

    I already patched the documentation in docrails, but we could do with the :time_with_seconds default format in time.

    October 12th, 2010 @ 11:10 PM

  2. Ryan Bigg
    Ryan Bigg

    So this patch is already applied?

    October 12th, 2010 @ 11:36 PM

  3. Aditya Sanghi
    Aditya Sanghi

    Not completely. The patch as documentation as well as a new default time format with tests. So no, it's not completely applied. Git should be able to merge the change when and if this patch is applied

    (or Ryan do you really want me to subtract my documentation change from this?)

    October 12th, 2010 @ 11:40 PM

  4. Ryan Bigg
    Ryan Bigg

    I think the documentation patch goes with the code patch, no?

    October 12th, 2010 @ 11:42 PM

  5. Aditya Sanghi
    Aditya Sanghi

    Ryan there are 2 distinct issues. A documentation bugfix (:time time format) and a small new enhancement (:time_with_seconds code+doc+test changes). The documentation bugfix related to :time was checked in on docrails already. The patch here includes that and the :time_with_seconds changes.

    October 13th, 2010 @ 07:28 AM

  6. Aditya Sanghi
    Aditya Sanghi

    Rebased against master and adding patch again.

    October 17th, 2010 @ 09:37 AM

  7. Aditya Sanghi
    Aditya Sanghi

    Are we looking for +1s here or does it seem small and useful enough to add anyway? @fxn ?

    November 1st, 2010 @ 11:16 AM

  8. Santiago Pastorino
    Santiago Pastorino
    • 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.

    February 2nd, 2011 @ 04:21 PM

  9. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:21 PM