Sha256: 5f25b1d2c89a18f0ec51cbabad4ae05c6cda6fc1ca81bdb3af99e05e20d6bc23

Contents?: true

Size: 573 Bytes

Versions: 1

Compression:

Stored size: 573 Bytes

Contents

module ActiveAdmin
  module Inputs
    module Filters
      class DateTimeRangeInput < DateRangeInput
        include Base

        def html_class
          "date-time-picker"
        end

        def format
          "%Y-%m-%d %H:%M"
        end

        def input_html_options(input_name = gt_input_name)
          current_value = @object.public_send input_name
          { size: 12,
            class: html_class,
            max: 10,
            value: current_value.respond_to?(:strftime) ? current_value.strftime(format) : "" }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_admin_datetimepicker-0.1.0 lib/active_admin_datetimepicker/inputs/filters/date_time_range_input.rb