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
|
||||
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue