mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
chore: support alternate format for recorded date
This commit is contained in:
parent
aa7af11a4e
commit
23d23c4962
1 changed files with 8 additions and 3 deletions
|
|
@ -48,7 +48,13 @@ class SurveyItemValues
|
|||
def recorded_date
|
||||
@recorded_date ||= begin
|
||||
recorded_date = value_from(pattern: /Recorded\s*Date/i)
|
||||
Date.parse(recorded_date)
|
||||
puts recorded_date
|
||||
date = nil
|
||||
begin
|
||||
date = Date.parse(recorded_date)
|
||||
rescue StandardError => e
|
||||
date = Date.strptime(recorded_date, "%m/%d/%Y")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -135,7 +141,6 @@ class SurveyItemValues
|
|||
race_codes ||= value_from(pattern: /RACE/i) || ""
|
||||
race_codes ||= []
|
||||
|
||||
|
||||
race_codes = race_codes.split(",")
|
||||
.map do |word|
|
||||
word.split(/\s+and\s+/i)
|
||||
|
|
@ -150,7 +155,7 @@ class SurveyItemValues
|
|||
race_codes = race_codes.push(4) if hispanic == "true"
|
||||
end
|
||||
|
||||
Race.normalize_race_list(race_codes)
|
||||
Race.normalize_race_list(race_codes)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue