Skip to content

Commit

Permalink
Make it possible to say Time.now.in(1.year)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@735 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Feb 21, 2005
1 parent b08f353 commit 6e84d82
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -35,6 +35,7 @@ def ago(seconds)
def since(seconds)
seconds.since(self)
end
alias :in :since

# Returns a new Time representing the time a number of specified months ago
def months_ago(months)
Expand Down Expand Up @@ -62,7 +63,7 @@ def last_month
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
Expand Down

0 comments on commit 6e84d82

Please sign in to comment.