Sha256: 100c46d94f0b34e2a125a8f5228ccb7f9d731286ec75c2ff50d149c6b483a779

Contents?: true

Size: 503 Bytes

Versions: 16

Compression:

Stored size: 503 Bytes

Contents

module Puffer
  module Inputs
    class DateTime < Puffer::Inputs::Base

      def input
        format = case field.type
          when :date                    then '%Y-%m-%d'
          when :time                    then '%H:%M:%S'
          when :datetime, :timestamp    then '%Y-%m-%d %H:%M:%S'
        end
        builder.text_field field, field.input_options.merge("data-calendar" => "{showButtons: true, listYears: true, format: '#{format}'}", :autocomplete => :off)
      end

    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
puffer-0.0.23 lib/puffer/inputs/date_time.rb
puffer-0.0.22 lib/puffer/inputs/date_time.rb
puffer-0.0.21 lib/puffer/inputs/date_time.rb
puffer-0.0.20 lib/puffer/inputs/date_time.rb
puffer-0.0.19 lib/puffer/inputs/date_time.rb
puffer-0.0.18 lib/puffer/inputs/date_time.rb
puffer-0.0.17 lib/puffer/inputs/date_time.rb
puffer-0.0.16 lib/puffer/inputs/date_time.rb
puffer-0.0.15 lib/puffer/inputs/date_time.rb
puffer-0.0.14 lib/puffer/inputs/date_time.rb
puffer-0.0.13 lib/puffer/inputs/date_time.rb
puffer-0.0.12 lib/puffer/inputs/date_time.rb
puffer-0.0.11 lib/puffer/inputs/date_time.rb
puffer-0.0.10 lib/puffer/inputs/date_time.rb
puffer-0.0.9 lib/puffer/inputs/date_time.rb
puffer-0.0.8 lib/puffer/inputs/date_time.rb