This project is archived and is in readonly mode.

#5792 ✓stale
Aditya Sanghi

Fix Documentation of to_formatted_s and give love to seconds

Reported by Aditya Sanghi | October 12th, 2010 @ 09:17 AM | in 3.x

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).

Comments and changes to this ticket

  • Aditya Sanghi

    Aditya Sanghi October 12th, 2010 @ 11:10 PM

    • 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.

  • Ryan Bigg

    Ryan Bigg October 12th, 2010 @ 11:36 PM

    So this patch is already applied?

  • Aditya Sanghi

    Aditya Sanghi October 12th, 2010 @ 11:40 PM

    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?)

  • Ryan Bigg

    Ryan Bigg October 12th, 2010 @ 11:42 PM

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

  • Aditya Sanghi

    Aditya Sanghi October 13th, 2010 @ 07:28 AM

    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.

  • Aditya Sanghi

    Aditya Sanghi October 17th, 2010 @ 09:37 AM

    Rebased against master and adding patch again.

  • Aditya Sanghi

    Aditya Sanghi November 1st, 2010 @ 11:16 AM

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

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:21 PM

    • 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.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:21 PM

    • State changed from “open” to “stale”

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>

Attachments

Pages