Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ruby 1.9: fix Time#beginning_of_day inaccuracy due to subtracting a F…

…loat
  • Loading branch information...
commit a60779f7e69a7045a308844e9464d7d6b9cac94d 1 parent 63f9426
@jeremy jeremy authored
View
3  activesupport/lib/active_support/core_ext/time/calculations.rb
@@ -201,7 +201,8 @@ def next_week(day = :monday)
# Returns a new Time representing the start of the day (0:00)
def beginning_of_day
- (self - self.seconds_since_midnight).change(:usec => 0)
+ #(self - seconds_since_midnight).change(:usec => 0)
+ change(:hour => 0, :min => 0, :sec => 0, :usec => 0)
end
alias :midnight :beginning_of_day
alias :at_midnight :beginning_of_day
Please sign in to comment.
Something went wrong with that request. Please try again.