diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-05-11 17:10:44 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-05-11 17:10:44 -0700 |
commit | 8cf4725f640603944bb6e69816807f6541c94d9f (patch) | |
tree | 89d384796f5aa88724bd24df6d6683b7cf844fb8 /activesupport/lib/active_support/core_ext/time/calculations.rb | |
parent | f5fcfc2ab61696842659e579c85b955208489665 (diff) | |
parent | 377bd69e295086f72c623e6323698eeb1d8a0a34 (diff) | |
download | rails-8cf4725f640603944bb6e69816807f6541c94d9f.tar.gz rails-8cf4725f640603944bb6e69816807f6541c94d9f.tar.bz2 rails-8cf4725f640603944bb6e69816807f6541c94d9f.zip |
Merge pull request #227 from farski/master
Unnecessary redundancy in Time/Date calculations
Diffstat (limited to 'activesupport/lib/active_support/core_ext/time/calculations.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/time/calculations.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb index 7e134db118..dcac17536a 100644 --- a/activesupport/lib/active_support/core_ext/time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/time/calculations.rb @@ -187,7 +187,7 @@ class Time # Returns a new Time representing the start of the day (0:00) def beginning_of_day #(self - seconds_since_midnight).change(:usec => 0) - change(:hour => 0, :min => 0, :sec => 0, :usec => 0) + change(:hour => 0) end alias :midnight :beginning_of_day alias :at_midnight :beginning_of_day @@ -201,7 +201,7 @@ class Time # Returns a new Time representing the start of the month (1st of the month, 0:00) def beginning_of_month #self - ((self.mday-1).days + self.seconds_since_midnight) - change(:day => 1,:hour => 0, :min => 0, :sec => 0, :usec => 0) + change(:day => 1, :hour => 0) end alias :at_beginning_of_month :beginning_of_month @@ -227,7 +227,7 @@ class Time # Returns a new Time representing the start of the year (1st of january, 0:00) def beginning_of_year - change(:month => 1, :day => 1, :hour => 0, :min => 0, :sec => 0, :usec => 0) + change(:month => 1, :day => 1, :hour => 0) end alias :at_beginning_of_year :beginning_of_year |