Browse Source

Remove days of the week from copy

pull/2940/head
Kat 3 months ago
parent
commit
6b6a7bbf9e
  1. 4
      app/helpers/tasklist_helper.rb
  2. 6
      spec/helpers/tasklist_helper_spec.rb

4
app/helpers/tasklist_helper.rb

@ -81,9 +81,9 @@ module TasklistHelper
deadline_for_log = log_quarter.cutoff_date
if deadline_for_log.beginning_of_day >= Time.zone.today.beginning_of_day
"<p class=\"govuk-body\">#{log_quarter.quarter} Deadline: #{log_quarter.cutoff_date.strftime('%A %-d %B %Y')}.<p>".html_safe
"<p class=\"govuk-body\">#{log_quarter.quarter} Deadline: #{log_quarter.cutoff_date.strftime('%-d %B %Y')}.<p>".html_safe
else
"<p class=\"govuk-body app-red-text\"><strong>Overdue: #{log_quarter.quarter} deadline #{log_quarter.cutoff_date.strftime('%A %-d %B %Y')}.</strong></p>".html_safe
"<p class=\"govuk-body app-red-text\"><strong>Overdue: #{log_quarter.quarter} deadline #{log_quarter.cutoff_date.strftime('%-d %B %Y')}.</strong></p>".html_safe
end
end

6
spec/helpers/tasklist_helper_spec.rb

@ -227,7 +227,7 @@ RSpec.describe TasklistHelper do
it "returns the deadline text" do
allow(Time.zone).to receive(:today).and_return(Time.zone.local(2025, 5, 7))
expect(deadline_text(log)).to include("Q1 Deadline: ")
expect(deadline_text(log)).to include("Q1 Deadline: 11 July 2025.")
end
end
@ -236,7 +236,7 @@ RSpec.describe TasklistHelper do
it "returns the overdue text" do
allow(Time.zone).to receive(:today).and_return(Time.zone.local(2025, 6, 6))
expect(deadline_text(log)).to include("Q4 Deadline: ")
expect(deadline_text(log)).to include("Q4 Deadline: 6 June 2025.")
end
end
@ -245,7 +245,7 @@ RSpec.describe TasklistHelper do
it "returns the overdue text" do
allow(Time.zone).to receive(:today).and_return(Time.zone.local(2025, 6, 7))
expect(deadline_text(log)).to include("Overdue: Q4 deadline")
expect(deadline_text(log)).to include("Overdue: Q4 deadline 6 June 2025.")
end
end
end

Loading…
Cancel
Save