From eb99ac32ce8306c7f55343c8aeb8554fda6884ba Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Wed, 3 Jan 2024 12:51:01 +0000 Subject: [PATCH] Fix lettings log accessor in date question (#2117) * Fix lettings log accessor in date question * Remove hardcoded date example from mrcdate question (#2118) --------- Co-authored-by: Rachael Booth --- app/models/form/lettings/questions/mrcdate.rb | 1 - app/views/form/_date_question.html.erb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/form/lettings/questions/mrcdate.rb b/app/models/form/lettings/questions/mrcdate.rb index cadcd3a7a..09176dca6 100644 --- a/app/models/form/lettings/questions/mrcdate.rb +++ b/app/models/form/lettings/questions/mrcdate.rb @@ -6,7 +6,6 @@ class Form::Lettings::Questions::Mrcdate < ::Form::Question @header = "When were the repairs completed?" @type = "date" @check_answers_card_number = 0 - @hint_text = "For example, 27 3 2021." @question_number = 24 end end diff --git a/app/views/form/_date_question.html.erb b/app/views/form/_date_question.html.erb index 9de5b8f2d..1be21d212 100644 --- a/app/views/form/_date_question.html.erb +++ b/app/views/form/_date_question.html.erb @@ -3,7 +3,7 @@ <%= f.govuk_date_field question.id.to_sym, caption: caption(caption_text, page_header, conditional), legend: legend(question, page_header, conditional), - hint: { text: (question.hint_text.nil? ? "" : (question.hint_text.html_safe + "

".html_safe)) + "For example, #{date_mid_collection_year_formatted(lettings_log.startdate)}" }, + hint: { text: (question.hint_text.nil? ? "" : (question.hint_text.html_safe + "

".html_safe)) + "For example, #{date_mid_collection_year_formatted(@log.startdate)}" }, width: 20, **stimulus_html_attributes(question) do %> <%= govuk_inset_text(text: question.unresolved_hint_text) if question.unresolved_hint_text.present? && @log.unresolved %>