Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIx incorrect dates in 'Get involved' page #4638

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/get_involved.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def next_closing_consultation
def recently_opened_consultations
query = {
filter_content_store_document_type: "open_consultation",
fields: "end_date,title,link,organisations",
fields: "public_timestamp,end_date,title,link,organisations",
order: "-start_date",
count: 3,
}
Expand All @@ -47,7 +47,7 @@ def recent_consultation_outcomes
query = {
filter_content_store_document_type: "consultation_outcome",
filter_end_date: "to: #{Time.zone.now.to_date}",
fields: "end_date,title,link,organisations",
fields: "public_timestamp,end_date,title,link,organisations",
order: "-end_date",
count: 3,
}
Expand Down
23 changes: 14 additions & 9 deletions app/presenters/get_involved_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,25 @@ def filtered_links(array, close_status)
link: {
text: item["title"],
path: item["link"],
description: "#{close_status} #{item['end_date'].to_date.strftime('%d %B %Y')}",
},
metadata: {
public_updated_at: Time.zone.parse(org_time(item)),
document_type: org_acronym(item),
description: closing_date_text(item, close_status),
},
subtext: updated_date_text(item),
}
end
end

def org_time(item)
item["organisations"].map { |org|
org["public_timestamp"]
}.join(", ")
def date_format
"%e %B %Y"
end

def closing_date_text(item, close_status)
"#{close_status}: #{item['end_date'].to_date.strftime(date_format)}"
end

def updated_date_text(item)
"#{I18n.t('formats.get_involved.updated')}: "\
"#{item['public_timestamp'].to_date.strftime(date_format)} "\
"(#{org_acronym(item)})"
end

def org_acronym(item)
Expand Down
1 change: 1 addition & 0 deletions config/locales/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ ar:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ az:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ be:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ bg:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/bn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ bn:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ cs:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ cy:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change: Newid
Expand Down
1 change: 1 addition & 0 deletions config/locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ da:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ de:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/dr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ dr:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ el:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ en:
start_a_petition: Start a petition
take_part: Take part
take_part_suggestions: Many people are already volunteering, donating and contributing, both in the UK and abroad. If you'd like to join them, but dont know where to start, here's a list of suggestions
updated: Updated
your_views: You can give your views on new or changing government policies by responding to consultations. Government departments take these responses into consideration before making decisions.
licence:
change: Change
Expand Down
1 change: 1 addition & 0 deletions config/locales/es-419.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ es-419:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ es:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ et:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/fa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ fa:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ fi:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ fr:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/gd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ gd:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/gu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ gu:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/he.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ he:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/hi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ hi:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ hr:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/hu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ hu:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/hy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ hy:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/id.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ id:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/is.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ is:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ it:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ ja:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/ka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ ka:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/kk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ kk:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ ko:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/lt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ lt:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/lv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ lv:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ ms:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/mt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ mt:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/ne.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ ne:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ nl:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/no.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/pa-pk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ pa-pk:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/pa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ pa:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ pl:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
1 change: 1 addition & 0 deletions config/locales/ps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ ps:
start_a_petition:
take_part:
take_part_suggestions:
updated:
your_views:
licence:
change:
Expand Down
Loading
Loading