From 3cadeaf90f3e4f1ae9c2e9b556f7688916ed622b Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Tue, 21 Feb 2023 11:52:04 -0500 Subject: [PATCH] FIX: Add support for Europe/Kyiv timezone (#20394) --- Gemfile | 2 ++ Gemfile.lock | 3 +++ spec/models/user_option_spec.rb | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/Gemfile b/Gemfile index 96506d54b53..28c4836adc3 100644 --- a/Gemfile +++ b/Gemfile @@ -279,3 +279,5 @@ gem "webrick", require: false # Workaround until Ruby ships with cgi version 0.3.6 or higher. gem "cgi", ">= 0.3.6", require: false + +gem "tzinfo-data" diff --git a/Gemfile.lock b/Gemfile.lock index 957b1ccd0c8..4949b76e9eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -486,6 +486,8 @@ GEM timeout (0.3.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) + tzinfo-data (1.2022.7) + tzinfo (>= 1.0.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) unf (0.1.4) @@ -657,6 +659,7 @@ DEPENDENCIES syntax_tree-disable_ternary test-prof thor + tzinfo-data uglifier unf unicorn diff --git a/spec/models/user_option_spec.rb b/spec/models/user_option_spec.rb index c7f3c79d8f7..9c5eef73d17 100644 --- a/spec/models/user_option_spec.rb +++ b/spec/models/user_option_spec.rb @@ -178,6 +178,13 @@ RSpec.describe UserOption do ActiveSupport::TimeZone.find_tzinfo("Europe/Paris"), ) end + + it "works for Europe/Kyiv" do + user.user_option.update(timezone: "Europe/Kyiv") + expect(UserOption.user_tzinfo(user.id)).to eq( + ActiveSupport::TimeZone.find_tzinfo("Europe/Kyiv"), + ) + end end context "with user with invalid timezone given" do