Sha256: 84ce2eb2214ab5c8cb3edb332605bf77cdd7036d5e45a1598126f367257f1418

Contents?: true

Size: 783 Bytes

Versions: 2

Compression:

Stored size: 783 Bytes

Contents

# frozen_string_literal: true

module ActiveAdmin
  module Inputs
    class DatetimepickerInput < ::Formtastic::Inputs::StringInput
      
      def input_html_options
        if options[:datetimepicker_options].nil?
          super.merge(class: 'ui-datetime-picker-input', autocomplete: 'off')
        else
          super.merge(class: 'ui-datetime-picker-input', autocomplete: 'off', datetimepicker_options: options[:datetimepicker_options].to_json)
        end
      end

      def wrapper_html_options_raw
        { class: 'ui-datetime-picker-wrapper' }.merge(options[:wrapper_html] || {}).dup
      end

      def label_html_options
        {
          for: input_html_options[:id],
          class: ['label'] << 'ui-datetime-picker-label'
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
date_n_time_picker_activeadmin-0.1.2 lib/inputs/datetimepicker_input.rb
date_n_time_picker_activeadmin-0.1.1 lib/inputs/datetimepicker_input.rb