Class: DateRangeInput

Inherits:
SimpleForm::Inputs::Base
  • Object
show all
Defined in:
app/inputs/date_range_input.rb

Instance Method Summary collapse

Instance Method Details

#input(wrapper_options) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'app/inputs/date_range_input.rb', line 2

def input(wrapper_options)
  start_date = options[:start_date] || :start_date
  end_date = options[:end_date] || :end_date
  template.(:div, class: 'input-group date form_datetime') do
    template.concat @builder.text_field start_date, class: "daterangepicker js-start_date"
    template.concat span_seperator
    template.concat @builder.text_field end_date, class: "daterangepicker js-end_date"
  end
end

#span_seperatorObject



12
13
14
15
16
# File 'app/inputs/date_range_input.rb', line 12

def span_seperator
  template.(:span, class: 'daterangepicker-seperator') do
    template.concat "to"
  end
end