Sha256: 5c20ca9f83d3429e6a829d6c7d1cd5322cab1cd8521ef0c80bfea829b3e91475

Contents?: true

Size: 953 Bytes

Versions: 4

Compression:

Stored size: 953 Bytes

Contents

# frozen_string_literal: true

module Eac
  module CommonFormHelper
    class FormBuilder
      module DateField
        def date_field(field_name, options = {})
          field_options = options.extract!(:use_month_numbers, :use_two_digit_numbers,
                                           :use_short_month, :add_month_numbers, :use_month_names,
                                           :month_format_string, :date_separator, :start_year,
                                           :end_year, :discard_day, :discard_month, :discard_year,
                                           :order, :include_blank, :default, :selected, :disabled,
                                           :prompt, :with_css_classes)
          field(field_name, options) do
            @helper.content_tag(:div, @form.date_select(field_name, field_options),
                                class: 'form-control-complex')
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
eac_rails_utils-0.10.1 lib/eac/common_form_helper/form_builder/date_field.rb
eac_rails_utils-0.10.0 lib/eac/common_form_helper/form_builder/date_field.rb
eac_rails_utils-0.9.1 lib/eac/common_form_helper/form_builder/date_field.rb
eac_rails_utils-0.9.0 lib/eac/common_form_helper/form_builder/date_field.rb