Browse files

AS guide: adds a catchall note about date calculations around the cal…

…endar reform
  • Loading branch information...
1 parent c31b386 commit 345c38a5277400e96a0b6992192037f0eaa81718 @fxn fxn committed May 9, 2010
Showing with 2 additions and 0 deletions.
  1. +2 −0 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,, 10, 4).tomorrow+ returns, 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, 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+.

0 comments on commit 345c38a

Please sign in to comment.