Sha256: d95ebf32432036a9785c0ae2496626a6caa85f45d37639aac55966252280a98a

Contents?: true

Size: 373 Bytes

Versions: 102

Compression:

Stored size: 373 Bytes

Contents

# frozen_string_literal: true

require "active_support/core_ext/time/zones"

module ActiveModel
  module Type
    module Helpers # :nodoc: all
      module Timezone
        def is_utc?
          ::Time.zone_default.nil? || ::Time.zone_default.match?("UTC")
        end

        def default_timezone
          is_utc? ? :utc : :local
        end
      end
    end
  end
end

Version data entries

102 entries across 97 versions & 11 rubygems

Version Path
activemodel-7.0.7 lib/active_model/type/helpers/timezone.rb
activemodel-7.0.6 lib/active_model/type/helpers/timezone.rb
activemodel-7.0.5.1 lib/active_model/type/helpers/timezone.rb
activemodel-6.1.7.4 lib/active_model/type/helpers/timezone.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activemodel-7.0.2.3/lib/active_model/type/helpers/timezone.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activemodel-6.1.6.1/lib/active_model/type/helpers/timezone.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activemodel-7.0.3.1/lib/active_model/type/helpers/timezone.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activemodel-7.0.4/lib/active_model/type/helpers/timezone.rb
activemodel-7.0.5 lib/active_model/type/helpers/timezone.rb
activemodel-7.0.4.3 lib/active_model/type/helpers/timezone.rb
activemodel-6.1.7.3 lib/active_model/type/helpers/timezone.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activemodel-7.0.4/lib/active_model/type/helpers/timezone.rb
activemodel-6.1.7.2 lib/active_model/type/helpers/timezone.rb
activemodel-7.0.4.2 lib/active_model/type/helpers/timezone.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activemodel-7.0.4/lib/active_model/type/helpers/timezone.rb
activemodel-7.0.4.1 lib/active_model/type/helpers/timezone.rb
activemodel-6.1.7.1 lib/active_model/type/helpers/timezone.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activemodel-7.0.4/lib/active_model/type/helpers/timezone.rb
activemodel-7.0.4 lib/active_model/type/helpers/timezone.rb
activemodel-6.1.7 lib/active_model/type/helpers/timezone.rb