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

Use Time.zone.parse instead of Date.parse in ManualUpdatesPresenter #2959

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
2 changes: 1 addition & 1 deletion app/presenters/content_item/manual_updates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def change_notes
end

def updated_at(published_at)
Date.parse(published_at)
Time.zone.parse(published_at).to_date
end

def group_updates_by_year(updates)
Expand Down
6 changes: 3 additions & 3 deletions test/presenters/content_item/manual_updates_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def initialize
"base_path" => "/guidance/content-design/content-policy",
"title" => "Content policy",
"change_note" => "New section added.",
"published_at" => "2014-10-06T23:49:25Z",
"published_at" => "2014-10-06T22:49:25Z",
},
{
"base_path" => "/guidance/content-design/user-needs",
Expand All @@ -34,7 +34,7 @@ def initialize
"base_path" => "/guidance/content-design/random-section",
"title" => "Random section",
"change_note" => "New section added.",
"published_at" => "2013-11-06T10:49:25Z",
"published_at" => "2013-09-06T23:49:25Z",
},
],
},
Expand Down Expand Up @@ -88,7 +88,7 @@ def initialize
2013,
[
[
"6 November 2013 <span class=\"govuk-visually-hidden\">#{I18n.t('manuals.updates_amendments')}</span>",
"7 September 2013 <span class=\"govuk-visually-hidden\">#{I18n.t('manuals.updates_amendments')}</span>",
{
(fourth_note["base_path"]).to_s => [fourth_note],
},
Expand Down