aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_support_core_extensions.textile
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-05-09 11:39:57 +0300
committerXavier Noria <fxn@hashref.com>2010-05-09 11:41:13 +0300
commit345c38a5277400e96a0b6992192037f0eaa81718 (patch)
treefe4038b4e333b0896a465c1e0026cf35bc1fa2ab /railties/guides/source/active_support_core_extensions.textile
parentc31b386a8834130471a297faa720bfe4ff2e884e (diff)
downloadrails-345c38a5277400e96a0b6992192037f0eaa81718.tar.gz
rails-345c38a5277400e96a0b6992192037f0eaa81718.tar.bz2
rails-345c38a5277400e96a0b6992192037f0eaa81718.zip
AS guide: adds a catchall note about date calculations around the calendar reform
Diffstat (limited to 'railties/guides/source/active_support_core_extensions.textile')
-rw-r--r--railties/guides/source/active_support_core_extensions.textile2
1 files changed, 2 insertions, 0 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile
index a3cb864796..091a639270 100644
--- a/railties/guides/source/active_support_core_extensions.textile
+++ b/railties/guides/source/active_support_core_extensions.textile
@@ -2652,6 +2652,8 @@ h4. Calculations
All the following methods are defined in +active_support/core_ext/date/calculations.rb+.
+WARNING: The following calculation methods have edge cases in November 1582, since days 5..14 just do not exist. This guide does not document their behavior around those days for brevity, but it is enough to say that they do what you would expect. That is, +Date.new(1582, 10, 4).tomorrow+ returns +Date.new(1582, 10, 15)+ and so on. Please check +test/core_ext/date_ext_test.rb+ in the Active Support test suite for expected behavior.
+
h5. +Date.current+
Active Support defines +Date.current+ to be today in the current time zone. That's like +Date.today+, except that it honors +Time.zone_default+. It also defines +Date.yesterday+ and +Date.tomorrow+, and the instance predicates +past?+, +today?+, and +future?+, all of them relative to +Date.current+.