From 66a6f8def93dcb3c068ad2bb352d3c52951af693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com> Date: Thu, 8 Feb 2024 15:57:32 +0100 Subject: [PATCH] display event time zone if different from website --- app/models/communication/website/agenda/event/with_time.rb | 2 +- .../admin/communication/websites/agenda/events/_dates.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/communication/website/agenda/event/with_time.rb b/app/models/communication/website/agenda/event/with_time.rb index 4f2078fd5..9da9f67fc 100644 --- a/app/models/communication/website/agenda/event/with_time.rb +++ b/app/models/communication/website/agenda/event/with_time.rb @@ -56,7 +56,7 @@ module Communication::Website::Agenda::Event::WithTime protected def set_time_zone - self.time_zone = Time.zone.name if self.time_zone.nil? + self.time_zone = website.default_time_zone if self.time_zone.blank? end def set_to_day diff --git a/app/views/admin/communication/websites/agenda/events/_dates.html.erb b/app/views/admin/communication/websites/agenda/events/_dates.html.erb index 7528bc5be..68a6fb78e 100644 --- a/app/views/admin/communication/websites/agenda/events/_dates.html.erb +++ b/app/views/admin/communication/websites/agenda/events/_dates.html.erb @@ -21,7 +21,7 @@ day_format = detailed ? :full <%= l(event.to_hour, format: :time_only) if event.to_hour %> <% end %> <% end %> -<% unless event.from_hour.nil? && event.to_hour.nil? %> +<% unless event.from_hour.nil? && event.to_hour.nil? || event.time_zone == @website.default_time_zone %> <br> <%= t('admin.communication.website.agenda.events.formatted_time_zone', time_zone: event.time_zone) %> <% end %> \ No newline at end of file -- GitLab