lib/actv/event.rb in actv-2.5.0 vs lib/actv/event.rb in actv-2.5.1

- old
+ new

@@ -97,17 +97,17 @@ ############ # Returns the asset's registration open date # in UTC. This is pulled from the salesStartDate def registration_open_date - Time.parse "#{authoritative_reg_start_date} UTC" + Time.parse parse_date_with_correct_timezone_or_offset(authoritative_reg_start_date) end # Returns the asset's registration end date # in UTC. This is pulled from the salesEndDate def registration_close_date - Time.parse "#{authoritative_reg_end_date} UTC" + Time.parse parse_date_with_correct_timezone_or_offset(authoritative_reg_end_date) end # Returns the asset's start date # in UTC. This is pulled from the activityStartDate. def event_start_date @@ -158,9 +158,17 @@ alias reg_not_open? registration_not_yet_open? alias reg_not_yet_open? registration_not_yet_open? alias ended? event_ended? private + + def parse_date_with_correct_timezone_or_offset date + if self.awcamps30? || self.awcamps? || self.regcenter2? || self.regcenter? + "#{date} #{format_timezone_offset(place.timezoneOffset)}" + else + "#{date} UTC" + end + end # EG: -7 => "-0700" def format_timezone_offset(offset) (offset < 0 ? "-" : "") << offset.abs.to_s.rjust(2,'0') << '00' end