Sha256: 14607d9b7cda35be8914a34d4350836b34a6f7d7949f9fa8db99851dbeaf40db

Contents?: true

Size: 804 Bytes

Versions: 25

Compression:

Stored size: 804 Bytes

Contents

module ActiveAdmin
  module Inputs
    class FilterDateRangeInput

      def to_html
        input_wrapping do
          [ label_html,
            builder.text_field(gt_input_name, input_html_options(gt_input_name, 'datepickergte')),
            template.content_tag(:span, "-", :class => "seperator"),
            builder.text_field(lt_input_name, input_html_options(lt_input_name, 'datepickerlte')),
          ].join("\n").html_safe
        end
      end

      def input_html_options(input_name = gt_input_name, extra_class = '')
        current_value = @object.send(input_name)
        { :size => 12,
          :class => "datepicker #{extra_class}",
          :max => 10,
          :value => current_value.respond_to?(:strftime) ? current_value.strftime("%Y-%m-%d") : "" }
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
smartkiosk-server-0.11.1 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.11 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.19 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.18 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.17 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.16 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.15 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.14 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.13 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.12 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.11 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.10 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.9 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.8 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.7 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.5 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.4 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.3 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.2 lib/active_admin/inputs/filter_date_range_input_fix.rb
smartkiosk-server-0.10.1 lib/active_admin/inputs/filter_date_range_input_fix.rb