aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_support_core_extensions.textile
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2011-11-26 23:43:52 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2011-11-26 23:43:52 +0530
commitab854db6493bd684e9db1dc1d6461b11dfbb2e58 (patch)
tree3a991614c713384a11fb0ae8177190699a029183 /railties/guides/source/active_support_core_extensions.textile
parent80ac4dc6d0632937ccf61b38bc15fc2f6e27b18b (diff)
downloadrails-ab854db6493bd684e9db1dc1d6461b11dfbb2e58.tar.gz
rails-ab854db6493bd684e9db1dc1d6461b11dfbb2e58.tar.bz2
rails-ab854db6493bd684e9db1dc1d6461b11dfbb2e58.zip
documenting monday and sunday methods
Diffstat (limited to 'railties/guides/source/active_support_core_extensions.textile')
-rw-r--r--railties/guides/source/active_support_core_extensions.textile11
1 files changed, 11 insertions, 0 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile
index a58be1f309..2dee440b3b 100644
--- a/railties/guides/source/active_support_core_extensions.textile
+++ b/railties/guides/source/active_support_core_extensions.textile
@@ -3053,6 +3053,17 @@ d.end_of_week(:sunday) # => Sat, 08 May 2010
+beginning_of_week+ is aliased to +at_beginning_of_week+ and +end_of_week+ is aliased to +at_end_of_week+.
+h6. +monday+, +sunday+
+
+The methods +monday+ and +sunday+ return the dates for the beginning and
+end of the week, respectively. Weeks are assumed to start on Monday.
+
+<ruby>
+d = Date.new(2010, 5, 8) # => Sat, 08 May 2010
+d.monday # => Mon, 03 May 2010
+d.sunday # => Sun, 09 May 2010
+</ruby>
+
h6. +prev_week+, +next_week+
The method +next_week+ receives a symbol with a day name in English (in lowercase, default is +:monday+) and it returns the date corresponding to that day: