Module: BootstrapForm::Datetimepicker
- Defined in:
- lib/bootstrap_form/datetimepicker.rb
Instance Method Summary collapse
- #date_field(name, *args) ⇒ Object
- #datetime_local_field(name, *args) ⇒ Object (also: #datetime_field)
Instance Method Details
#date_field(name, *args) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/bootstrap_form/datetimepicker.rb', line 3 def date_field(name, *args) = args..symbolize_keys! (name, ) [:input_group][:data].merge!({'date-format' => 'L', 'date-extra-formats' => [BootstrapForm::DATE_FORMAT_JS]}.merge([:data] || {})) append_min_max(BootstrapForm::DATE_FORMAT_RUBY, ) args << super end |
#datetime_local_field(name, *args) ⇒ Object Also known as: datetime_field
def datetime_field(name, *args)
options = args.extract_options!.symbolize_keys!
options[:datetimepicker] = true
options[:append] = calendar_addon
args << options
super
end
20 21 22 23 24 25 26 27 |
# File 'lib/bootstrap_form/datetimepicker.rb', line 20 def datetime_local_field(name, *args) = args..symbolize_keys! (name, ) [:input_group][:data].merge!({'date-extra-formats' => [BootstrapForm::DATE_FORMAT_JS+"THH:mm"+([:include_seconds] ? ':ss' : '')]}.merge([:data] || {})) append_min_max(BootstrapForm::DATE_FORMAT_RUBY+"T%T", ) args << super end |