提交 e93d0a50 编写于 作者: J Jeremy Kemper

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

上级 b58acea5
......@@ -172,7 +172,8 @@ def next_week(day = :monday)
# 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册