fix: loosen restrictions on date format

This commit is contained in:
Nelson Jovel 2024-03-01 10:15:32 -08:00
parent 289b04bc69
commit 2cb43058a0

View file

@ -48,7 +48,7 @@ class SurveyItemValues
def recorded_date
@recorded_date ||= begin
recorded_date = value_from(pattern: /Recorded\s*Date/i)
date = if recorded_date.match(%r{\d+/\d+/\d+\s+\d+:\d+:\d+})
date = if recorded_date.match(%r{\d+/\d+/\d+})
Date.strptime(recorded_date, "%m/%d/%Y")
elsif recorded_date.match(/\d+-\d+-\d+(T|\s)\d+:\d+:\d+/)
Date.parse(recorded_date)