From 1f4685ae4bb22343606681337788b31b0638cca7 Mon Sep 17 00:00:00 2001 From: Hugo Sarti Date: Thu, 23 Sep 2021 15:50:08 -0300 Subject: [PATCH] fix: offset issue for Business hours on timezones with DST --- app/views/api/v1/widget/configs/create.json.jbuilder | 2 +- app/views/widgets/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/api/v1/widget/configs/create.json.jbuilder b/app/views/api/v1/widget/configs/create.json.jbuilder index 8a7696a87..8fbd5a502 100644 --- a/app/views/api/v1/widget/configs/create.json.jbuilder +++ b/app/views/api/v1/widget/configs/create.json.jbuilder @@ -16,7 +16,7 @@ json.chatwoot_website_channel do json.csat_survey_enabled @web_widget.inbox.csat_survey_enabled json.working_hours @web_widget.inbox.working_hours json.out_of_office_message @web_widget.inbox.out_of_office_message - json.utc_off_set ActiveSupport::TimeZone[@web_widget.inbox.timezone].formatted_offset + json.utc_off_set ActiveSupport::TimeZone[@web_widget.inbox.timezone].now.formatted_offset end json.chatwoot_widget_defaults do json.use_inbox_avatar_for_bot ActiveModel::Type::Boolean.new.cast(ENV.fetch('USE_INBOX_AVATAR_FOR_BOT', false)) diff --git a/app/views/widgets/show.html.erb b/app/views/widgets/show.html.erb index 04f8ac0e6..6c4d38f88 100644 --- a/app/views/widgets/show.html.erb +++ b/app/views/widgets/show.html.erb @@ -23,7 +23,7 @@ csatSurveyEnabled: <%= @web_widget.inbox.csat_survey_enabled %>, workingHours: <%= @web_widget.inbox.working_hours.to_json.html_safe %>, outOfOfficeMessage: <%= @web_widget.inbox.out_of_office_message.to_json.html_safe %>, - utcOffset: '<%= ActiveSupport::TimeZone[@web_widget.inbox.timezone].formatted_offset %>' + utcOffset: '<%= ActiveSupport::TimeZone[@web_widget.inbox.timezone].now.formatted_offset %>' } window.chatwootWidgetDefaults = { useInboxAvatarForBot: <%= ActiveModel::Type::Boolean.new.cast(ENV.fetch('USE_INBOX_AVATAR_FOR_BOT', false)) %>,