aliases Date#sunday to Date#end_of_week, for symmetry with existing alias Date#monday -> Date#beginning_of_week

This commit is contained in:
Xavier Noria
2010-05-09 11:16:34 +02:00
parent 2969543cef
commit df508bd970
2 changed files with 3 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
*Rails 3.0.0 [beta 4/release candidate] (unreleased)*
* Aliases Date#sunday to Date#end_of_week. [fxn]
* Backports Date#>> from 1.9 so that calculations do the right thing around the calendar reform. [fxn]
* Date#to_time handles properly years in the range 0..138. [fxn]

View File

@@ -181,6 +181,7 @@ class Date
result = self + days_to_sunday.days
self.acts_like?(:time) ? result.end_of_day : result
end
alias :sunday :end_of_week
alias :at_end_of_week :end_of_week
# Returns a new Date/DateTime representing the start of the given day in next week (default is Monday).