diff --git a/app/helpers/collection_time_helper.rb b/app/helpers/collection_time_helper.rb
index ad7dac6a9..1e8c0eef4 100644
--- a/app/helpers/collection_time_helper.rb
+++ b/app/helpers/collection_time_helper.rb
@@ -16,10 +16,13 @@ module CollectionTimeHelper
Time.zone.local(collection_start_year_for_date(date), 4, 1)
end
- def date_mid_collection_year_formatted(date)
+ def date_mid_collection_year(date)
relevant_year = date.nil? ? current_collection_start_year : collection_start_year_for_date(date)
- example_date = Date.new(relevant_year, 9, 13)
- example_date.to_formatted_s(:govuk_date_number_month)
+ Date.new(relevant_year, 9, 13)
+ end
+
+ def date_mid_collection_year_formatted(date)
+ date_mid_collection_year(date).to_formatted_s(:govuk_date_number_month)
end
def current_collection_start_date
diff --git a/app/helpers/form_page_helper.rb b/app/helpers/form_page_helper.rb
index 74e75e572..98b9bb8d5 100644
--- a/app/helpers/form_page_helper.rb
+++ b/app/helpers/form_page_helper.rb
@@ -1,4 +1,6 @@
module FormPageHelper
+ include CollectionTimeHelper
+
def action_href(log, page_id, referrer = "check_answers")
send("#{log.log_type}_#{page_id}_path", log, referrer:)
end
@@ -46,4 +48,11 @@ module FormPageHelper
page.skip_href(log) || send(log.form.next_page_redirect_path(page, log, current_user, ignore_answered: true), log)
end
end
+
+ def date_hint(question, log)
+ [
+ question.hint_text.presence,
+ question.date_example_override(log) || "For example, #{date_mid_collection_year_formatted(log.startdate).tr(' ', '/')}",
+ ].compact.join("
").html_safe
+ end
end
diff --git a/app/models/form/lettings/questions/gender_same_as_sex.rb b/app/models/form/lettings/questions/gender_same_as_sex.rb
index 1fdfddda5..0b0fd55b5 100644
--- a/app/models/form/lettings/questions/gender_same_as_sex.rb
+++ b/app/models/form/lettings/questions/gender_same_as_sex.rb
@@ -7,6 +7,7 @@ class Form::Lettings::Questions::GenderSameAsSex < ::Form::Question
@conditional_for = { "gender_description#{person_index}" => [2] }
@person_index = person_index
@question_number = question_number
+ @inferred_check_answers_value = [{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]
end
def answer_options
diff --git a/app/models/form/lettings/questions/tenancy_start_date.rb b/app/models/form/lettings/questions/tenancy_start_date.rb
index cf1b556e7..b7d82b399 100644
--- a/app/models/form/lettings/questions/tenancy_start_date.rb
+++ b/app/models/form/lettings/questions/tenancy_start_date.rb
@@ -1,4 +1,6 @@
class Form::Lettings::Questions::TenancyStartDate < ::Form::Question
+ include CollectionTimeHelper
+
def initialize(id, hsh, page)
super
@id = "startdate"
@@ -7,5 +9,16 @@ class Form::Lettings::Questions::TenancyStartDate < ::Form::Question
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present?
end
+ def date_example_override(log)
+ return unless form.start_year_2026_or_later?
+
+ example_date =
+ [date_mid_collection_year(log.startdate), Time.zone.today + 7]
+ .min
+ .to_formatted_s(:govuk_date_number_month)
+ .tr(" ", "/")
+ I18n.t("forms.#{form.start_date.year}.#{copy_key}.example", default: "", example_date:)
+ end
+
QUESTION_NUMBER_FROM_YEAR = { 2023 => 5, 2024 => 7 }.freeze
end
diff --git a/app/models/form/question.rb b/app/models/form/question.rb
index 3c29bdaac..e5bc0c9a6 100644
--- a/app/models/form/question.rb
+++ b/app/models/form/question.rb
@@ -299,6 +299,11 @@ class Form::Question
answer_options.keys.reject { |x| x.match(/divider/) }
end
+ # used by date questions that need bespoke formatting for the example date
+ def date_example_override(_log)
+ nil
+ end
+
private
def selected_answer_option_is_derived?(log)
diff --git a/app/models/validations/soft_validations.rb b/app/models/validations/soft_validations.rb
index 662aa9af6..9b6816dd1 100644
--- a/app/models/validations/soft_validations.rb
+++ b/app/models/validations/soft_validations.rb
@@ -329,6 +329,8 @@ private
end
def at_least_one_person_working_situation_is_illness?
+ return if hhmemb.present? && hhmemb > 8
+
person_count = hhmemb || 8
(1..person_count).any? { |n| public_send("ecstat#{n}") == 8 }
diff --git a/app/views/form/_date_question.html.erb b/app/views/form/_date_question.html.erb
index a1df5f4d5..28437f3b9 100644
--- a/app/views/form/_date_question.html.erb
+++ b/app/views/form/_date_question.html.erb
@@ -6,7 +6,7 @@
question_id: question.id,
legend: { text: legend[:text], size: legend[:size], caption: caption(caption_text, page_header, conditional) },
resource_type: @log.log_type,
- hint: (question.hint_text.blank? ? "" : (question.hint_text.html_safe + "".html_safe)) + "For example, #{date_mid_collection_year_formatted(@log.startdate).tr(' ', '/')}",
+ hint: date_hint(question, @log),
f:,
} %>
diff --git a/config/locales/forms/2026/lettings/setup.en.yml b/config/locales/forms/2026/lettings/setup.en.yml
index a68a489d2..bfd08e55d 100644
--- a/config/locales/forms/2026/lettings/setup.en.yml
+++ b/config/locales/forms/2026/lettings/setup.en.yml
@@ -63,7 +63,8 @@ en:
page_header: ""
check_answer_label: "Tenancy start date"
check_answer_prompt: ""
- hint_text: ""
+ hint_text: "The tenancy start date can be up to 14 days from today. If your tenancy starts more than 14 days into the future, please wait until you are within 14 days of the start date before submitting your log.
For example, if you’re answering this question on 1 April, you can enter a tenancy start date up to and including 15 April."
+ example: "Enter the date in the format DD/MM/YYYY, for example %{example_date}."
question_text: "What is the tenancy start date?"
rent_type:
diff --git a/spec/models/form/lettings/questions/gender_same_as_sex_spec.rb b/spec/models/form/lettings/questions/gender_same_as_sex_spec.rb
index 65734d9ef..09a9ef19f 100644
--- a/spec/models/form/lettings/questions/gender_same_as_sex_spec.rb
+++ b/spec/models/form/lettings/questions/gender_same_as_sex_spec.rb
@@ -42,7 +42,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do
end
it "has the correct inferred_check_answers_value" do
- expect(question.inferred_check_answers_value).to be_nil
+ expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }])
end
it "has the correct question number" do
@@ -72,7 +72,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do
end
it "has the correct inferred_check_answers_value" do
- expect(question.inferred_check_answers_value).to be_nil
+ expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }])
end
it "has the correct question number" do
@@ -102,7 +102,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do
end
it "has the correct inferred_check_answers_value" do
- expect(question.inferred_check_answers_value).to be_nil
+ expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }])
end
it "has the correct question number" do
@@ -132,7 +132,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do
end
it "has the correct inferred_check_answers_value" do
- expect(question.inferred_check_answers_value).to be_nil
+ expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }])
end
it "has the correct question number" do
@@ -162,7 +162,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do
end
it "has the correct inferred_check_answers_value" do
- expect(question.inferred_check_answers_value).to be_nil
+ expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }])
end
it "has the correct question number" do
@@ -192,7 +192,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do
end
it "has the correct inferred_check_answers_value" do
- expect(question.inferred_check_answers_value).to be_nil
+ expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }])
end
it "has the correct question number" do
@@ -222,7 +222,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do
end
it "has the correct inferred_check_answers_value" do
- expect(question.inferred_check_answers_value).to be_nil
+ expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }])
end
it "has the correct question number" do
@@ -252,7 +252,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do
end
it "has the correct inferred_check_answers_value" do
- expect(question.inferred_check_answers_value).to be_nil
+ expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }])
end
it "has the correct question number" do