Added last_month and next_month

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@734 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 25f8a25c
......@@ -53,6 +53,16 @@ def months_since(months)
end
end
# Short-hand for months_ago(1)
def last_month
months_ago(1)
end
# Short-hand for months_since(1)
def next_month
months_since(1)
end
# Returns a new Time representing the "start" of this week (Monday, 0:00)
def beginning_of_week
(self - self.wday.days).midnight + 1.day
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册