From f1d5bfa042267638c5d69096b0ca59c136346ed1 Mon Sep 17 00:00:00 2001 From: Charlie Parker Date: Fri, 9 Aug 2024 12:54:41 -0400 Subject: [PATCH] bs4 family info fix immigrant fields (#4256) move script end tag to allow field div to load for bs4, fix exp date parsing --- .../app/models/financial_assistance/forms/consumer_fields.rb | 4 +++- .../shared/_immigration_document_fields.html.erb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/financial_assistance/app/models/financial_assistance/forms/consumer_fields.rb b/components/financial_assistance/app/models/financial_assistance/forms/consumer_fields.rb index 7e2833fb30d..bc4c6245d07 100644 --- a/components/financial_assistance/app/models/financial_assistance/forms/consumer_fields.rb +++ b/components/financial_assistance/app/models/financial_assistance/forms/consumer_fields.rb @@ -33,7 +33,9 @@ def expiration_date end def expiration_date=(val) - @expiration_date = Date.strptime(val, '%m/%d/%Y') if val.to_s.present? + return unless val.to_s.present? + date_format = val.match(/\d{4}-\d{2}-\d{2}/) ? "%Y-%m-%d" : "%m/%d/%Y" + @expiration_date = Date.strptime(val, date_format) end def us_citizen diff --git a/components/financial_assistance/app/views/financial_assistance/shared/_immigration_document_fields.html.erb b/components/financial_assistance/app/views/financial_assistance/shared/_immigration_document_fields.html.erb index 1e6d2400974..34ffb2e0ccb 100644 --- a/components/financial_assistance/app/views/financial_assistance/shared/_immigration_document_fields.html.erb +++ b/components/financial_assistance/app/views/financial_assistance/shared/_immigration_document_fields.html.erb @@ -36,6 +36,7 @@
+<% end %> <% if vlp_doc_subject.present? %> <% end %> -<% end %>