From 2692e0296a89ff785164b33187971783d318c6c9 Mon Sep 17 00:00:00 2001
From: pabois <pierreandre.boissinot@noesya.coop>
Date: Fri, 8 Sep 2023 15:19:55 +0200
Subject: [PATCH] add date_range_i18n

---
 Gemfile                                                       | 3 ++-
 Gemfile.lock                                                  | 2 ++
 .../communication/websites/agenda/events/static.html.erb      | 4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Gemfile b/Gemfile
index 53b050864..81cb8ddd4 100644
--- a/Gemfile
+++ b/Gemfile
@@ -38,6 +38,7 @@ gem "hal_openscience", "~> 0.1"
 gem "has_scope", "~> 0.8.0"
 gem "hash_dot"
 gem "i18n_data", "~> 0.17.1"
+gem "i18n_date_range", "~> 0.1.0"
 gem "image_processing"
 gem "jbuilder"
 gem "jquery-rails"
@@ -93,4 +94,4 @@ group :test do
   gem "simplecov", require: false
 end
 
-gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
+gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
\ No newline at end of file
diff --git a/Gemfile.lock b/Gemfile.lock
index ec027c15b..4ba3d37c8 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -275,6 +275,7 @@ GEM
       concurrent-ruby (~> 1.0)
     i18n_data (0.17.1)
       simple_po_parser (~> 1.1)
+    i18n_date_range (0.1.0)
     image_processing (1.12.2)
       mini_magick (>= 4.9.5, < 5)
       ruby-vips (>= 2.0.17, < 3)
@@ -614,6 +615,7 @@ DEPENDENCIES
   has_scope (~> 0.8.0)
   hash_dot
   i18n_data (~> 0.17.1)
+  i18n_date_range (~> 0.1.0)
   image_processing
   jbuilder
   jquery-rails
diff --git a/app/views/admin/communication/websites/agenda/events/static.html.erb b/app/views/admin/communication/websites/agenda/events/static.html.erb
index fc6d33d66..de3fda683 100644
--- a/app/views/admin/communication/websites/agenda/events/static.html.erb
+++ b/app/views/admin/communication/websites/agenda/events/static.html.erb
@@ -4,8 +4,8 @@ dates:
   status: "<%= @about.status %>"
   archive: <%= @about.archive? %>
   computed:
-    short: "Du 14 au 16 juin 2023"
-    long: "Du mercredi 14 au vendredi 16 juin 2023"
+    short: <%= date_range_i18n(@about.from_day, @about.to_day) %>
+    long: <%= date_range_i18n(@about.from_day, @about.to_day, :long) %>
   from:
     day: <%= @about.from_day %>
 <% if @about.from_hour %>
-- 
GitLab