Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make it possible to say Time.now.in(1.year)

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@735 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 6e84d82ce95a09f80f431b6c0a70900f9cb6a3da 1 parent b08f353
@dhh dhh authored
View
3  activesupport/lib/active_support/core_ext/time/calculations.rb
@@ -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)
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.