Sha256: 002f3693ff7bdde3c6e43c30ac2af1a6f541968612bc4ab89ad77b130d44a697

Contents?: true

Size: 368 Bytes

Versions: 61

Compression:

Stored size: 368 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 =~ "UTC"
        end

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

Version data entries

61 entries across 61 versions & 6 rubygems

Version Path
activemodel-5.2.4.1 lib/active_model/type/helpers/timezone.rb
activemodel-6.0.2 lib/active_model/type/helpers/timezone.rb
activemodel-6.0.2.rc2 lib/active_model/type/helpers/timezone.rb
activemodel-5.2.4 lib/active_model/type/helpers/timezone.rb
activemodel-6.0.2.rc1 lib/active_model/type/helpers/timezone.rb
activemodel-5.2.4.rc1 lib/active_model/type/helpers/timezone.rb
activemodel-6.0.1 lib/active_model/type/helpers/timezone.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/activemodel-6.0.0/lib/active_model/type/helpers/timezone.rb
activemodel-6.0.1.rc1 lib/active_model/type/helpers/timezone.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/activemodel-6.0.0/lib/active_model/type/helpers/timezone.rb
activemodel-6.0.0 lib/active_model/type/helpers/timezone.rb
spiral_form-0.1.1 vendor/bundle/gems/activemodel-5.2.3/lib/active_model/type/helpers/timezone.rb
spiral_form-0.1.0 vendor/bundle/gems/activemodel-5.2.3/lib/active_model/type/helpers/timezone.rb
activemodel-6.0.0.rc2 lib/active_model/type/helpers/timezone.rb
ric-0.13.0 vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.3/lib/active_model/type/helpers/timezone.rb
ric-0.12.2 vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.3/lib/active_model/type/helpers/timezone.rb
activemodel-6.0.0.rc1 lib/active_model/type/helpers/timezone.rb
activemodel-5.2.3 lib/active_model/type/helpers/timezone.rb
activemodel-5.2.3.rc1 lib/active_model/type/helpers/timezone.rb
activemodel-6.0.0.beta3 lib/active_model/type/helpers/timezone.rb