diff options
author | Geoff Buesing <gbuesing@gmail.com> | 2007-11-24 04:59:21 +0000 |
---|---|---|
committer | Geoff Buesing <gbuesing@gmail.com> | 2007-11-24 04:59:21 +0000 |
commit | becdb49186c575bf96a82a949ac04b6078680d52 (patch) | |
tree | 48c91b2df8feba4a7e6795c161a2e92970bc323c /activesupport/lib/active_support/core_ext/time | |
parent | d84846a636fbc180b3d6fcf52aa8559e1b7bb960 (diff) | |
download | rails-becdb49186c575bf96a82a949ac04b6078680d52.tar.gz rails-becdb49186c575bf96a82a949ac04b6078680d52.tar.bz2 rails-becdb49186c575bf96a82a949ac04b6078680d52.zip |
Honor Ruby's default calendar reform setting when creating DateTime objects via ActiveRecord's Time -> DateTime overflow, Time#time_with_datetime_fallback, Time#to_datetime, Date#to_datetime and String#to_datetime. Closes #10201
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8199 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext/time')
-rw-r--r-- | activesupport/lib/active_support/core_ext/time/calculations.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/time/conversions.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb index e9f1011563..7181bac3fd 100644 --- a/activesupport/lib/active_support/core_ext/time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/time/calculations.rb @@ -36,7 +36,7 @@ module ActiveSupport #:nodoc: ::Time.send(utc_or_local, year, month, day, hour, min, sec, usec) rescue offset = utc_or_local.to_sym == :local ? ::DateTime.local_offset : 0 - ::DateTime.civil(year, month, day, hour, min, sec, offset, 0) + ::DateTime.civil(year, month, day, hour, min, sec, offset) end # wraps class method time_with_datetime_fallback with utc_or_local == :utc diff --git a/activesupport/lib/active_support/core_ext/time/conversions.rb b/activesupport/lib/active_support/core_ext/time/conversions.rb index c0bc8b4313..4b6ad1eef3 100644 --- a/activesupport/lib/active_support/core_ext/time/conversions.rb +++ b/activesupport/lib/active_support/core_ext/time/conversions.rb @@ -43,7 +43,7 @@ module ActiveSupport #:nodoc: # converts to a Ruby DateTime instance; preserves utc offset def to_datetime - ::DateTime.civil(year, month, day, hour, min, sec, Rational(utc_offset, 86400), 0) + ::DateTime.civil(year, month, day, hour, min, sec, Rational(utc_offset, 86400)) end end end |