Sha256: a622a51e991301d7cd43552f1f8c087b455aed78c6ceefa846528efbfe4c9628

Contents?: true

Size: 543 Bytes

Versions: 44

Compression:

Stored size: 543 Bytes

Contents

module ActionView
  module Helpers
    module Tags # :nodoc:
      class DatetimeField < TextField # :nodoc:
        def render
          options = @options.stringify_keys
          options["value"] ||= format_date(value(object))
          options["min"] = format_date(options["min"])
          options["max"] = format_date(options["max"])
          @options = options
          super
        end

        private

          def format_date(value)
            value.try(:strftime, "%Y-%m-%dT%T.%L%z")
          end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 3 rubygems

Version Path
actionview-4.1.16 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.16.rc1 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.15 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.15.rc1 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.14.2 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.14.1 lib/action_view/helpers/tags/datetime_field.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/actionview-4.1.13/lib/action_view/helpers/tags/datetime_field.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/actionview-4.1.13/lib/action_view/helpers/tags/datetime_field.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/actionview-4.1.13/lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.14 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.14.rc2 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.14.rc1 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.13 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.13.rc1 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.12 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.12.rc1 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.11 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.10 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.10.rc4 lib/action_view/helpers/tags/datetime_field.rb
actionview-4.1.10.rc3 lib/action_view/helpers/tags/datetime_field.rb