Skip to content

Commit

Permalink
Merge pull request #11310 from demarches-simplifiees/same_date_dateti…
Browse files Browse the repository at this point in the history
…me_format

ETQ agent, je vois les dates et les dates et heures avec le mois écrit en toutes lettres
  • Loading branch information
LeSim authored Feb 20, 2025
2 parents cc260c2 + 592ba93 commit b601843
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 deletions.
6 changes: 6 additions & 0 deletions config/locales/time_format.fr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
}
},

date: {
formats: {
default: "%d %B %Y"
}
},

datetime: {
distance_in_words: {
x_weeks: {
Expand Down
4 changes: 2 additions & 2 deletions spec/components/instructeurs/cell_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

before { dossier.champs.first.update(value: Date.parse("12/02/2025")) }

it { is_expected.to eq('12/02/2025') }
it { is_expected.to eq('12 février 2025') }
end

context 'for a datetime column' do
Expand All @@ -102,7 +102,7 @@
etablissement.update_champ_value_json!
}

it { is_expected.to eq('10/08/2015') }
it { is_expected.to eq('10 août 2015') }
end

context 'for a enum column' do
Expand Down
4 changes: 2 additions & 2 deletions spec/components/instructeurs/filter_buttons_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def to_filter((label, filter)) = FilteredColumn.new(column: procedure.find_colum
let(:filter) { to_filter(['Date de création', "15/06/2023"]) }

it 'should get formatted value' do
expect(page).to have_text("15/06/2023")
expect(page).to have_text("15 juin 2023")
end
end

Expand All @@ -57,7 +57,7 @@ def to_filter((label, filter)) = FilteredColumn.new(column: procedure.find_colum
end

it 'should display all filters' do
text = "État du dossier : En construction ou État du dossier : En instruction et Date de création : 15/06/2023"
text = "État du dossier : En construction ou État du dossier : En instruction et Date de création : 15 juin 2023"
expect(page).to have_text(text)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
context 'dossier en instruction' do
let(:dossier) { create(:dossier, :en_instruction, procedure:, sva_svr_decision_on: Date.new(2023, 9, 5)) }
it { expect(subject).to have_text("dans 4 jours") }
it { expect(title).to have_text("sera automatiquement traité le 05/09/2023") }
it { expect(title).to have_text("sera automatiquement traité le 05 septembre 2023") }

context 'with label' do
let(:with_label) { true }
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/dossier_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
context "with complete france_connect information" do
let(:user_information) { build(:france_connect_information, updated_at: Time.zone.now) }
it {
expect(subject).to have_text("Le dossier a été déposé par le compte de #{user_information.given_name} #{user_information.family_name}, authentifié par FranceConnect le #{user_information.updated_at.strftime('%d/%m/%Y')}")
expect(subject).to have_text("Le dossier a été déposé par le compte de #{user_information.given_name} #{user_information.family_name}, authentifié par FranceConnect le #{I18n.l(user_information.updated_at.to_date)}")
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/system/administrateurs/procedure_closing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

procedure.reload

expect(page).to have_text("Un email a été envoyé pour informer les usagers le #{procedure.closed_at.strftime('%d/%m/%Y')}")
expect(page).to have_text("Un email a été envoyé pour informer les usagers le #{I18n.l(procedure.closed_at.to_date)}")
end
end
end
6 changes: 3 additions & 3 deletions spec/system/api_particulier/api_particulier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@
expect(page).to have_content('pays FRANCE')
expect(page).to have_content('complément d’identité géographique au nord de paris')
expect(page).to have_content('lieu-dit glagla')
expect(page).to have_content('ERIC SNOW masculin 07/01/1991')
expect(page).to have_content('SANSA SNOW féminin 15/01/1992')
expect(page).to have_content('PAUL SNOW masculin 04/01/2018')
expect(page).to have_content('ERIC SNOW masculin 07 janvier 1991')
expect(page).to have_content('SANSA SNOW féminin 15 janvier 1992')
expect(page).to have_content('PAUL SNOW masculin 04 janvier 2018')
expect(page).to have_content('1856 6 2021')
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/views/instructeur/dossiers/show.html.haml_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
end

it 'fills the individual with the informations from France Connect' do
expect(view.content_for(:notice_info)).to have_text("Le dossier a été déposé par le compte de #{france_connect_information.given_name} #{france_connect_information.family_name}, authentifié par FranceConnect le #{france_connect_information.updated_at.strftime('%d/%m/%Y')}")
expect(view.content_for(:notice_info)).to have_text("Le dossier a été déposé par le compte de #{france_connect_information.given_name} #{france_connect_information.family_name}, authentifié par FranceConnect le #{I18n.l(france_connect_information.updated_at.to_date)}")
end
end

Expand Down

0 comments on commit b601843

Please sign in to comment.