lib/spark_api/models/subresource.rb in spark_api-1.4.31 vs lib/spark_api/models/subresource.rb in spark_api-1.4.32
- old
+ new
@@ -14,13 +14,13 @@
collect(connection.get("/listings/#{parent_id}#{self.path}/#{id}", arguments)).first
end
def parse_date_start_and_end_times(attributes)
# Transform the date strings
- unless attributes['Date'].nil?
+ unless attributes['Date'].nil? || attributes['Date'].empty?
date = Date.strptime attributes['Date'], '%m/%d/%Y'
['StartTime','EndTime'].each do |time|
- next if attributes[time].nil?
+ next if attributes[time].nil? || attributes[time].empty?
formatted_date = "#{attributes['Date']}T#{attributes[time]}"
datetime = nil
begin
datetime = DateTime.strptime(formatted_date, '%m/%d/%YT%l:%M %P')