Module: Golden::DatepickerConcern

Extended by:
ActiveSupport::Concern
Included in:
ApplicationOperator
Defined in:
lib/golden/active_model_concerns/datepicker_concern.rb

Instance Method Summary collapse

Instance Method Details

#filter_dates_of_datepicker(fields, attrs) ⇒ Object



16
17
18
19
20
21
# File 'lib/golden/active_model_concerns/datepicker_concern.rb', line 16

def filter_dates_of_datepicker(fields, attrs)
  fields.each do |field|
    dates = attrs.delete(field)
    attrs[field] = date_of_datepicker(dates)
  end
end

#filter_duration_of_datepicker(field, attrs) ⇒ Object



23
24
25
26
27
28
# File 'lib/golden/active_model_concerns/datepicker_concern.rb', line 23

def filter_duration_of_datepicker(field, attrs)
  return [] unless attrs.key? field

  dates = attrs.delete(field)
  duration_of_datepicker(dates)
end