12 lines
286 B
Ruby
12 lines
286 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Accounts
|
|
module_function
|
|
|
|
def normalize_timezone(timezone)
|
|
tzinfo = TZInfo::Timezone.get(ActiveSupport::TimeZone::MAPPING[timezone] || timezone)
|
|
|
|
::ActiveSupport::TimeZone.all.find { |e| e.tzinfo == tzinfo }&.name || timezone
|
|
end
|
|
end
|