Sha256: 20a569bbcf8fd5913267d35c364cc5e83b9294089e0658bd2b5b051daa98c804

Contents?: true

Size: 444 Bytes

Versions: 3

Compression:

Stored size: 444 Bytes

Contents

module Formulaic
  module Inputs
    class DateInput < Input
      def fill
        select_date(value, from: label)
      end

      private

      def select_date(date, options)
        field = find_field(options[:from].to_s)["id"].gsub(/_\di/, "")
        select date.year.to_s, from: "#{field}_1i"
        select Date::MONTHNAMES[date.month], from: "#{field}_2i"
        select date.day.to_s, from: "#{field}_3i"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
formulaic-0.1.3 lib/formulaic/inputs/date_input.rb
formulaic-0.1.2 lib/formulaic/inputs/date_input.rb
formulaic-0.1.1 lib/formulaic/inputs/date_input.rb