6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/ext_form/helpers/tags/dt_picker.rb', line 6
def render
if value_before_type_cast(object).present?
@options[:value] = value_before_type_cast(object).match(/\d{4}-\d{1,2}-\d{1,2}(\s\d{1,2}:\d{1,2}:\d{1,2})?/)
end
output = @template_object.content_tag(:div, nil, class: 'input-append') do
[super,
@template_object.content_tag(:span, nil, class: 'add-on') do
@template_object.content_tag(:i, nil, data: {:'time-icon' => 'icon-time',
:'date-icon' => 'icon-calendar'})
end
].join.html_safe
end
html_options = {}
add_default_name_and_id(html_options)
output << @template_object.javascript_tag do
"$(function(){$('##{html_options['id']}').trigger('dt_picker_load');});".html_safe
end
output.html_safe
end
|