diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-05-15 08:24:25 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-05-15 08:24:25 -0700 |
commit | 1c3e5bee3d426666da9bbab84f1939c5f58b5640 (patch) | |
tree | b7327f61bf17bd157b1e0b4cd53ad95d78b8f232 /activesupport/lib/active_support/values | |
parent | e3cc49cff779564615c7e9275113cbf907cf5494 (diff) | |
parent | 03becb13099c439f6aea5058546bc8b0b19b8db8 (diff) | |
download | rails-1c3e5bee3d426666da9bbab84f1939c5f58b5640.tar.gz rails-1c3e5bee3d426666da9bbab84f1939c5f58b5640.tar.bz2 rails-1c3e5bee3d426666da9bbab84f1939c5f58b5640.zip |
Merge pull request #5571 from jarkko/5559-fix-dst-jump-bug-on-master
[#5559] Do not black out the system timezone DST jump hour if Time.zone ...
Diffstat (limited to 'activesupport/lib/active_support/values')
-rw-r--r-- | activesupport/lib/active_support/values/time_zone.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb index 0059898ebf..28bc06f103 100644 --- a/activesupport/lib/active_support/values/time_zone.rb +++ b/activesupport/lib/active_support/values/time_zone.rb @@ -271,7 +271,12 @@ module ActiveSupport date_parts = Date._parse(str) return if date_parts.empty? time = Time.parse(str, now) rescue DateTime.parse(str) + if date_parts[:offset].nil? + if date_parts[:hour] && time.hour != date_parts[:hour] + time = DateTime.parse(str) + end + ActiveSupport::TimeWithZone.new(nil, self, time) else time.in_time_zone(self) |