DRY up "%b %d, %Y"
We have %b %d, %Y (following https://design.gitlab.com/content/date-and-time) in a few places. We should DRY this, probably in https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/locales/en.yml (similar to :long)
The following discussion from !122296 (merged) should be addressed:
-
@tkuah started a discussion: (+2 comments) = s_('Member since %{date}') % { date: l(@user.created_at.to_date, format: :long) }I know we wish to follow https://design.gitlab.com/content/date-and-time but let's follow that one up - For one thing we should DRY
"%b %d, %Y", and add it into https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/locales/en.yml - but let's follow up
List:
app/helpers/application_helper.rb: content_tag :time, l(time, format: "%b %d, %Y"),
app/views/projects/commits/_commits.html.haml: %span.day.font-weight-bold= l(day, format: '%b %d, %Y')
spec/features/admin/users/users_spec.rb: expect(page).to have_content(current_user.created_at.strftime('%b %d, %Y'))
spec/features/commits_spec.rb: expect(page).to have_content(day.strftime("%b %d, %Y"))
spec/features/commits_spec.rb: expect(page).to have_content("authored #{commit.authored_date.strftime("%b %d, %Y")}")
spec/features/commits_spec.rb: expect(page).to have_content("#{author_commit.author_name} authored #{commit.authored_date.strftime("%b %d, %Y")}")
spec/features/profiles/gpg_keys_spec.rb: expect(page).to have_selector('time.js-timeago', text: gpg_key.created_at.strftime('%b %d, %Y'))
spec/helpers/application_helper_spec.rb: expect(element.text).to eq @time.strftime("%b %d, %Y")
spec/helpers/application_helper_spec.rb: it { expect(helper.edited_time_ago_with_tooltip(merge_request)).to have_text("Edited #{now.strftime('%b %d, %Y')} by #{user.name}") }
spec/helpers/application_helper_spec.rb: it { expect(helper.edited_time_ago_with_tooltip(merge_request, exclude_author: true)).to have_text("Edited #{now.strftime('%b %d, %Y')}") }
spec/views/profiles/keys/_key.html.haml_spec.rb: expect(rendered).to have_text(l(key.created_at, format: "%b %d, %Y"))
spec/views/profiles/keys/_key.html.haml_spec.rb: expect(rendered).to have_text(l(key.last_used_at, format: "%b %d, %Y"))
spec/views/projects/issues/service_desk/_issue.html.haml_spec.rb: l(time, format: "%b %d, %Y")
spec/views/shared/runners/_runner_details.html.haml_spec.rb: let(:expected_contacted_at) { I18n.l(runner.contacted_at, format: "%b %d, %Y") }
Edited by Thong Kuah