Skip to content
Browse files

fedex events now really are UTC, Endica is assumed to be US Eastern w…

…hich is unlikely
  • Loading branch information...
1 parent 5727a8d commit 16127735e428994210d0a6b5a276ef5a2e6cd2cb @troystribling troystribling committed Mar 1, 2012
View
3 lib/active_shipping/shipping/carriers/endicia.rb
@@ -45,6 +45,7 @@ class Endicia < Carrier
'R' => 'RS',
'U' => 'SE',
'N' => 'OC',
+ 'EF' => 'AR',
'OF' => 'OD',
'OA' => 'PU',
'BB' => 'AR',
@@ -381,7 +382,7 @@ def parse_tracking_status(status_string)
caps = status.captures
return unless caps.length == 7
caps[0] = (caps[0].to_i + 12) if caps[2].eql?('PM')
- {:time=> Time.utc(caps[5], caps[3], caps[4], caps[0], caps[1]), :location => caps[6].chop.strip}
+ {:time=> Time.new(caps[5], caps[3], caps[4], caps[0], caps[1], "-04:00"), :location => caps[6].chop.strip}
end
end
View
5 lib/active_shipping/shipping/carriers/fedex.rb
@@ -846,9 +846,8 @@ def parse_tracking_response(response, opts)
location = Location.new(:city => city, :state => state, :postal_code => zip_code, :country => country)
type = event.get_text('EventType').to_s
description = event.get_text('EventDescription').to_s
- time = Time.parse("#{event.get_text('Timestamp').to_s}")
- zoneless_time = Time.utc(time.year, time.month, time.mday, time.hour, time.min, time.sec)
- shipment_events << ShipmentEvent.new(type, "#{description} at #{zoneless_time} in #{location}", zoneless_time, location)
+ time = Time.parse("#{event.get_text('Timestamp').to_s}").utc
+ shipment_events << ShipmentEvent.new(type, "#{description} at #{time} in #{location}", time, location)
end
shipment_events = shipment_events.sort_by(&:time)
TrackingResponse.new(

0 comments on commit 1612773

Please sign in to comment.
Something went wrong with that request. Please try again.