affiche uniquement l'année pour les bilans
This commit is contained in:
parent
75b24fbad5
commit
2fd88e3a17
2 changed files with 2 additions and 2 deletions
|
@ -40,6 +40,6 @@ module EtablissementHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def pretty_date_exercice(date)
|
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
|
||||||
end
|
end
|
||||||
|
|
|
@ -59,6 +59,6 @@ RSpec.describe EtablissementHelper, type: :helper do
|
||||||
end
|
end
|
||||||
describe '#pretty_date_exercice' do
|
describe '#pretty_date_exercice' do
|
||||||
subject { pretty_date_exercice("201908") }
|
subject { pretty_date_exercice("201908") }
|
||||||
it { is_expected.to eq("08/2019") }
|
it { is_expected.to eq("2019") }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue