Browse Source

Remove formatted helper

pull/2890/head
Manny Dinssa 4 weeks ago
parent
commit
8dd19b5aaa
  1. 4
      app/helpers/collection_deadline_helper.rb
  2. 3
      app/views/home/_upcoming_deadlines.html.erb

4
app/helpers/collection_deadline_helper.rb

@ -20,10 +20,6 @@ module CollectionDeadlineHelper
send("#{quarter}_quarter", year)[:cutoff_date].strftime("%A %-d %B %Y") send("#{quarter}_quarter", year)[:cutoff_date].strftime("%A %-d %B %Y")
end end
def formatted_deadline
quarterly_cutoff_date("fourth", current_collection_start_year)
end
def quarter_deadlines_for_year(year) def quarter_deadlines_for_year(year)
QUARTERLY_DEADLINES[year] QUARTERLY_DEADLINES[year]
end end

3
app/views/home/_upcoming_deadlines.html.erb

@ -1,13 +1,14 @@
<h1 class="govuk-heading-l">Upcoming deadlines</h1> <h1 class="govuk-heading-l">Upcoming deadlines</h1>
<% open_lettings_form = FormHandler.instance.in_crossover_period? ? FormHandler.instance.previous_lettings_form : FormHandler.instance.current_lettings_form %> <% open_lettings_form = FormHandler.instance.in_crossover_period? ? FormHandler.instance.previous_lettings_form : FormHandler.instance.current_lettings_form %>
<% formatted_deadline = "#{open_lettings_form.submission_deadline.strftime("%A %-d %B %Y")}" %>
<% if FormHandler.instance.in_crossover_period? %> <% if FormHandler.instance.in_crossover_period? %>
<p class="govuk-body govuk-body-m"><strong>End of year deadline - <%= formatted_deadline %>:</strong> Deadline to submit logs for tenancies starting between <%= open_lettings_form.start_date.to_formatted_s(:govuk_date) %> to <%= collection_end_date(open_lettings_form.start_date).to_formatted_s(:govuk_date) %></p> <p class="govuk-body govuk-body-m"><strong>End of year deadline - <%= formatted_deadline %>:</strong> Deadline to submit logs for tenancies starting between <%= open_lettings_form.start_date.to_formatted_s(:govuk_date) %> to <%= collection_end_date(open_lettings_form.start_date).to_formatted_s(:govuk_date) %></p>
<% end %> <% end %>
<% current_quarter = quarter_for_date(date: Time.zone.now) %> <% current_quarter = quarter_for_date(date: Time.zone.now) %>
<% if current_quarter.present? %> <% if current_quarter.present? %>
<p class="govuk-body govuk-body-m"><strong><%= "#{current_quarter.quarter} - #{current_quarter.cutoff_date.strftime('%A')} #{current_quarter.cutoff_date.to_formatted_s(:govuk_date)}" %>:</strong> Quarterly cut off date for tenancies and sales starting between <%= current_quarter.quarter_start_date.to_formatted_s(:govuk_date) %> and <%= current_quarter.quarter_end_date.to_formatted_s(:govuk_date) %>.</p> <p class="govuk-body govuk-body-m"><strong><%= "#{current_quarter.quarter} - #{current_quarter.cutoff_date.strftime("%A %-d %B %Y")}" %>:</strong> Quarterly cut off date for tenancies and sales starting between <%= current_quarter.quarter_start_date.to_formatted_s(:govuk_date) %> and <%= current_quarter.quarter_end_date.to_formatted_s(:govuk_date) %>.</p>
<% end %> <% end %>
<% unless FormHandler.instance.in_crossover_period? %> <% unless FormHandler.instance.in_crossover_period? %>

Loading…
Cancel
Save