diff options
author | Xavier Noria <fxn@hashref.com> | 2010-05-09 11:16:34 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-05-09 11:16:34 +0200 |
commit | df508bd97062b871fe25eda8d1bb61cd43d79bc4 (patch) | |
tree | 79c0643ceb269c33d78ab262bbcb003e4ce41a79 /activesupport/lib/active_support/core_ext/date/calculations.rb | |
parent | 2969543cef63de08a8da369b83007d17e8941b6e (diff) | |
download | rails-df508bd97062b871fe25eda8d1bb61cd43d79bc4.tar.gz rails-df508bd97062b871fe25eda8d1bb61cd43d79bc4.tar.bz2 rails-df508bd97062b871fe25eda8d1bb61cd43d79bc4.zip |
aliases Date#sunday to Date#end_of_week, for symmetry with existing alias Date#monday -> Date#beginning_of_week
Diffstat (limited to 'activesupport/lib/active_support/core_ext/date/calculations.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/date/calculations.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/date/calculations.rb b/activesupport/lib/active_support/core_ext/date/calculations.rb index 2612dca93a..3038729d34 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 @@ 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). |