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.

ActiveSupport lacks beginning_of_hour

#2114

Needed something to give me the beginning of the hour but it appears ActiveSupport lacks that. Code below


def beginning_of_hour
  change(:min => 0, :sec => 0, :usec => 0)
end

ahh, just realized this is more of a feature request :(, sorry.

Reported by Ryan Neufeld · March 3rd, 2009 @ 03:49 AM

State: open
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. Matías Flores
    Matías Flores
    • Tag changed from activesupport to activesupport, bugmash

    September 27th, 2009 @ 03:03 PM

  2. Matías Flores
    Matías Flores

    +1 for the feature

    I've attached a patch adding beginning_of_hour and end_of_hour support. Notice that there are two patch files, the first one applies to master and the other to 2-3-stable.

    September 27th, 2009 @ 03:05 PM

  3. hsume2 (Henry)
    hsume2 (Henry)

    +1, verified both patches apply successfully

    September 27th, 2009 @ 03:13 PM

  4. Elomar França
    Elomar França

    +1, verified.

    Agree with the addition, and both patches apply.

    September 27th, 2009 @ 03:52 PM

  5. Mike Enriquez
    Mike Enriquez

    +1 verified both patches. It may be worth discussing if we need beginning_of_minute and beginning_of_second.

    September 27th, 2009 @ 08:42 PM

  6. travis (at appoxy)
  7. Rizwan Reza
    Rizwan Reza
    • Tag changed from activesupport, bugmash to activesupport

    February 12th, 2010 @ 12:46 PM

  8. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  9. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open
    • Importance changed from to

    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:54 PM

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

    February 2nd, 2011 @ 04:54 PM

  11. Oscar Del Ben
    Oscar Del Ben
    • State changed from stale to open

    This hasn't been added to rails 3. Before rolling out a patch again is the core team interested at all in adding the feature?

    [state:open]

    February 12th, 2011 @ 10:38 AM