diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2012-12-01 20:43:07 +0000 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2012-12-01 21:05:42 +0000 |
commit | c89b6c4cdce7ee55ed3665c099d914222fe0344a (patch) | |
tree | c44170809b612cf0f09109442b4edfb3be47746f /activesupport/lib | |
parent | 583cc11dd75676665e1d106541979d94864ee663 (diff) | |
download | rails-c89b6c4cdce7ee55ed3665c099d914222fe0344a.tar.gz rails-c89b6c4cdce7ee55ed3665c099d914222fe0344a.tar.bz2 rails-c89b6c4cdce7ee55ed3665c099d914222fe0344a.zip |
Only take the date parts from Time.zone.now
When there are missing components in the Hash returned by
Date._parse only the date components should default to the
value of Time.zone.now, the time components should all
default to zero.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/values/time_zone.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb index 1a37d6f2a4..b6fca9df91 100644 --- a/activesupport/lib/active_support/values/time_zone.rb +++ b/activesupport/lib/active_support/values/time_zone.rb @@ -285,9 +285,9 @@ module ActiveSupport parts.fetch(:year, now.year), parts.fetch(:mon, now.month), parts.fetch(:mday, now.day), - parts.fetch(:hour, now.hour), - parts.fetch(:min, now.min), - parts.fetch(:sec, now.sec) + parts.fetch(:sec_fraction, 0), + parts.fetch(:hour, 0), + parts.fetch(:min, 0), + parts.fetch(:sec, 0) + parts.fetch(:sec_fraction, 0), parts.fetch(:offset, 0) ) |