mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Ruby 1.9: fix Time#beginning_of_day inaccuracy due to subtracting a Float
This commit is contained in:
parent
b58acea569
commit
e93d0a50c0
1 changed files with 2 additions and 1 deletions
|
@ -172,7 +172,8 @@ class Time
|
|||
|
||||
# Returns a new Time representing the start of the day (0:00)
|
||||
def beginning_of_day
|
||||
(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
|
||||
|
|
Loading…
Reference in a new issue