Sha256: 772c29bf3d71fcff24f00c0ba8413938868a7e10106dcd89fb91e65b1de2137a
Contents?: true
Size: 670 Bytes
Versions: 1
Compression:
Stored size: 670 Bytes
Contents
module SimpleForm module Inputs class DatePickerInput < Base def input @builder.datetime_field(attribute_name, input_html_options) end private def input_html_options if options.key? :value value = options[:value] elsif object.respond_to?(attribute_name) value = object.send(attribute_name) else value = '' end value = Time.zone.parse(value) if value.is_a?(String) value = value.strftime("%Y-%m-%d") if value.respond_to?(:strftime) { class: 'form-control text-center date datepicker', value: value.presence || '' } end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
simple_form_bootstrap3-0.3.0 | lib/simple_form/inputs/date_picker_input.rb |