aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-12-03 08:23:57 -0800
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-12-03 08:23:57 -0800
commit1441961f16c4ffe91109b044c9d3d31072d34109 (patch)
treeac3b7d5025573454169792b70c8b4078406f5ca5 /activesupport/lib
parent05a685eeb7b480de410d168c70bb432b2b290b99 (diff)
parent029f24ede99e99b3c988f84b4709add754459fc6 (diff)
downloadrails-1441961f16c4ffe91109b044c9d3d31072d34109.tar.gz
rails-1441961f16c4ffe91109b044c9d3d31072d34109.tar.bz2
rails-1441961f16c4ffe91109b044c9d3d31072d34109.zip
Merge pull request #12822 from cbartlett/master
Add support for localized date references
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb
index b6d9257f00..a22e61d286 100644
--- a/activesupport/lib/active_support/values/time_zone.rb
+++ b/activesupport/lib/active_support/values/time_zone.rb
@@ -317,6 +317,16 @@ module ActiveSupport
tzinfo.now.to_date
end
+ # Returns the next date in this time zone.
+ def tomorrow
+ today + 1
+ end
+
+ # Returns the previous date in this time zone.
+ def yesterday
+ today - 1
+ end
+
# Adjust the given time to the simultaneous time in the time zone
# represented by +self+. Returns a Time.utc() instance -- if you want an
# ActiveSupport::TimeWithZone instance, use Time#in_time_zone() instead.