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.1.5 lib/active_model/type/helpers/timezone.rb
activemodel-7.1.4.2 lib/active_model/type/helpers/timezone.rb
activemodel-7.0.8.6 lib/active_model/type/helpers/timezone.rb
activemodel-6.1.7.10 lib/active_model/type/helpers/timezone.rb
activemodel-6.1.7.9 lib/active_model/type/helpers/timezone.rb
activemodel-7.1.4.1 lib/active_model/type/helpers/timezone.rb
activemodel-7.0.8.5 lib/active_model/type/helpers/timezone.rb
activemodel-7.1.4 lib/active_model/type/helpers/timezone.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activemodel-7.1.3.4/lib/active_model/type/helpers/timezone.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activemodel-7.0.8.4/lib/active_model/type/helpers/timezone.rb
activemodel-7.2.0.beta3 lib/active_model/type/helpers/timezone.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/activemodel-7.0.5.1/lib/active_model/type/helpers/timezone.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/activemodel-7.0.5.1/lib/active_model/type/helpers/timezone.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/activemodel-7.0.5.1/lib/active_model/type/helpers/timezone.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/activemodel-7.1.3.4/lib/active_model/type/helpers/timezone.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/activemodel-7.1.3.4/lib/active_model/type/helpers/timezone.rb
activemodel-7.2.0.beta2 lib/active_model/type/helpers/timezone.rb
activemodel-7.1.3.4 lib/active_model/type/helpers/timezone.rb
activemodel-7.0.8.4 lib/active_model/type/helpers/timezone.rb
activemodel-6.1.7.8 lib/active_model/type/helpers/timezone.rb