diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index 1e01cfc45f110ef6f2dd17cc0330b5b0bf067dc4..6146cc6a97ec484f024da642c346f687bb3c699b 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -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] diff --git a/activesupport/lib/active_support/core_ext/date/calculations.rb b/activesupport/lib/active_support/core_ext/date/calculations.rb index 2612dca93a94a274f39c312369bdbebe08654829..3038729d34620e2d10128b4720d1e6160f9975d9 100644 --- a/activesupport/lib/active_support/core_ext/date/calculations.rb +++ b/activesupport/lib/active_support/core_ext/date/calculations.rb @@ -181,6 +181,7 @@ def end_of_week 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).