|
|
|
|
@ -80,6 +80,7 @@ private
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def with_headers? |
|
|
|
|
# we will eventually want to validate that headers exist for this year |
|
|
|
|
rows.map { |r| r[0] }.any? { |cell| cell&.match?(/field number/i) } |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
@ -100,9 +101,9 @@ private
|
|
|
|
|
|
|
|
|
|
def first_record_start_date |
|
|
|
|
if with_headers? |
|
|
|
|
Date.new(row_parsers.first.field_4.to_i + 2000, row_parsers.first.field_3.to_i, row_parsers.first.field_2.to_i) |
|
|
|
|
Date.new(row_parsers.first.field_6.to_i + 2000, row_parsers.first.field_5.to_i, row_parsers.first.field_4.to_i) |
|
|
|
|
else |
|
|
|
|
Date.new(rows.first[3].to_i + 2000, rows.first[2].to_i, rows.first[1].to_i) |
|
|
|
|
Date.new(rows.first[5].to_i + 2000, rows.first[4].to_i, rows.first[3].to_i) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|