FIX: Add support for Europe/Kyiv timezone (#20394)

This commit is contained in:
Penar Musaraj 2023-02-21 11:52:04 -05:00 committed by GitHub
parent 76260a4d79
commit 3cadeaf90f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -279,3 +279,5 @@ gem "webrick", require: false
# Workaround until Ruby ships with cgi version 0.3.6 or higher. # Workaround until Ruby ships with cgi version 0.3.6 or higher.
gem "cgi", ">= 0.3.6", require: false gem "cgi", ">= 0.3.6", require: false
gem "tzinfo-data"

View File

@ -486,6 +486,8 @@ GEM
timeout (0.3.2) timeout (0.3.2)
tzinfo (2.0.6) tzinfo (2.0.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
tzinfo-data (1.2022.7)
tzinfo (>= 1.0.0)
uglifier (4.2.0) uglifier (4.2.0)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
unf (0.1.4) unf (0.1.4)
@ -657,6 +659,7 @@ DEPENDENCIES
syntax_tree-disable_ternary syntax_tree-disable_ternary
test-prof test-prof
thor thor
tzinfo-data
uglifier uglifier
unf unf
unicorn unicorn

View File

@ -178,6 +178,13 @@ RSpec.describe UserOption do
ActiveSupport::TimeZone.find_tzinfo("Europe/Paris"), ActiveSupport::TimeZone.find_tzinfo("Europe/Paris"),
) )
end 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 end
context "with user with invalid timezone given" do context "with user with invalid timezone given" do