Sha256: 070b5a146e6e1cadbfcb1b28eb48dba5f928cfa2dd6dbdc52d7f70bff0f35caa
Contents?: true
Size: 557 Bytes
Versions: 14
Compression:
Stored size: 557 Bytes
Contents
class DatepickerInput < ActiveAdmin::Inputs::DatepickerInput # Override the HTML options to better work with the date picker and nil values. def input_html_options super.merge(value: (object.send(method) || Time.zone.now).strftime("%B %e, %Y").gsub(/\s\s/, " ")) end private # Override the datepicker options to set the date format. def datepicker_options datepicker_options = super datepicker_options[:datepicker_options] ||= {} datepicker_options[:datepicker_options][:dateFormat] = "MM d, yy" datepicker_options end end
Version data entries
14 entries across 14 versions & 1 rubygems