affiche uniquement l'année pour les bilans

This commit is contained in:
Christophe Robillard 2020-06-09 17:06:08 +02:00
parent 75b24fbad5
commit 2fd88e3a17
2 changed files with 2 additions and 2 deletions

View file

@ -40,6 +40,6 @@ module EtablissementHelper
end
def pretty_date_exercice(date)
date.sub(/(?<year>\d{4})(?<month>\d{2})/, '\k<month>/\k<year>') if date.present?
date.sub(/(?<year>\d{4})(?<month>\d{2})/, '\k<year>') if date.present?
end
end

View file

@ -59,6 +59,6 @@ RSpec.describe EtablissementHelper, type: :helper do
end
describe '#pretty_date_exercice' do
subject { pretty_date_exercice("201908") }
it { is_expected.to eq("08/2019") }
it { is_expected.to eq("2019") }
end
end