Sha256: af30dfabb61a689e1aec9b4e8ec5337d7437f73e6067a9026458f35df8990cd1

Contents?: true

Size: 558 Bytes

Versions: 43

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true

module ActionView
  module Helpers
    module Tags # :nodoc:
      class TimeField < DatetimeField # :nodoc:
        def initialize(object_name, method_name, template_object, options = {})
          @include_seconds = options.delete(:include_seconds) { true }
          super
        end

        private
          def format_datetime(value)
            if @include_seconds
              value&.strftime("%T.%L")
            else
              value&.strftime("%H:%M")
            end
          end
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 6 rubygems

Version Path
actionview-8.0.2 lib/action_view/helpers/tags/time_field.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/actionview-7.1.3.4/lib/action_view/helpers/tags/time_field.rb
actionview-8.0.1 lib/action_view/helpers/tags/time_field.rb
actionview-8.0.0.1 lib/action_view/helpers/tags/time_field.rb
actionview-7.2.2.1 lib/action_view/helpers/tags/time_field.rb
actionview-7.1.5.1 lib/action_view/helpers/tags/time_field.rb
actionview-8.0.0 lib/action_view/helpers/tags/time_field.rb
actionview-7.2.2 lib/action_view/helpers/tags/time_field.rb
actionview-7.1.5 lib/action_view/helpers/tags/time_field.rb
actionview-8.0.0.rc2 lib/action_view/helpers/tags/time_field.rb
actionview-7.2.1.2 lib/action_view/helpers/tags/time_field.rb
actionview-7.1.4.2 lib/action_view/helpers/tags/time_field.rb
actionview-8.0.0.rc1 lib/action_view/helpers/tags/time_field.rb
actionview-7.2.1.1 lib/action_view/helpers/tags/time_field.rb
actionview-7.1.4.1 lib/action_view/helpers/tags/time_field.rb
actionview-8.0.0.beta1 lib/action_view/helpers/tags/time_field.rb
omg-actionview-8.0.0.alpha9 lib/action_view/helpers/tags/time_field.rb
omg-actionview-8.0.0.alpha8 lib/action_view/helpers/tags/time_field.rb
omg-actionview-8.0.0.alpha7 lib/action_view/helpers/tags/time_field.rb
omg-actionview-8.0.0.alpha4 lib/action_view/helpers/tags/time_field.rb