%#
The following params are the variables that can be used in this partial.
@param form [Wallaby::FormBuilder] custom form object that adds a few helper methods and delegate missing methods to the view
@param object [Wallaby::ResourceDecorator] decorator instance which wraps the resource (e.g. ActiveRecord) instance
@param field_name [String] name of the field
@param value [Object] value of the field
@param metadata [Hash] metadata of the field
%>
<% picker_id1 = SecureRandom.uuid %>
<% picker_id2 = SecureRandom.uuid %>
<% unless @datetimepicker_init %>
<% @datetimepicker_init = true %>
<% content_for :custom_javascript do %>
<% javascript_tag do %>
jQuery(document).off(readyPrefix('.tstzrange')).on(readyPrefix('.tstzrange'), function () {
$('[data-init="datetimepicker"]').each(function() {
var $input = $('input', this),
val = ($input.attr('value') || '').split(' ').slice(0,2).join(' ');
$input.val(moment(val).format('YYYY-MM-DD HH:mm'));
$(this).datetimepicker({
format: 'YYYY-MM-DD HH:mm',
sideBySide: true
});
})
})
<% end %>
<% end %>
<% end %>