mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
documenting monday and sunday methods
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user