Sha256: 6a88b586fe554be1591a80828740f5b9ba9b1ad41c1805764fc77b00f917f163
Contents?: true
Size: 526 Bytes
Versions: 14
Compression:
Stored size: 526 Bytes
Contents
class AdminDateInput < SimpleForm::Inputs::Base include AdminBaseInput def input(wrapper_options) format = if column.type == :datetime then '%Y/%m/%d %H:%M' else '%Y/%m/%d' end default_input_html_options = {class: "#{column.type}picker", value: @builder.object.send(attribute_name).nil? ? "" : @builder.object.send(attribute_name).strftime(format)} options = merge_options(default_input_html_options, input_html_options) return "#{@builder.text_field(attribute_name, options)}".html_safe end end
Version data entries
14 entries across 14 versions & 1 rubygems