Sha256: e1d5be407e29aeaf73cb603562f9e3c47e2bda25cc4522caf15510b7b06e9cbb

Contents?: true

Size: 795 Bytes

Versions: 6

Compression:

Stored size: 795 Bytes

Contents

var initializer = function() {
  setupDateTimePicker(document);

  $(document).on('has_many_add:after', '.has_many_container', function(event, fieldset) {
    return setupDateTimePicker(fieldset);
  });

  function setupDateTimePicker(container) {
    var defaults = {
      formatDate: 'y-m-d',
      format: 'Y-m-d H:i',
      allowBlank: true,
      defaultSelect: false,
      validateOnBlur: false,
      scrollInput: false,
    };

    var entries = $(container).find('input.date-time-picker-input');
    return entries.each(function(index, entry) {
      var options = $(entry).data('picker-options');
      var mixedOptions = $.extend(defaults, options);
      return $(entry).datetimepicker(mixedOptions);
    });
  }
};

$(initializer);
$(document).on('turbolinks:load', initializer);

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
activeadmin_addons-1.9.0 app/javascript/activeadmin_addons/inputs/date-time-picker.js
activeadmin_addons-1.8.3 app/javascript/activeadmin_addons/inputs/date-time-picker.js
activeadmin_addons-1.8.2 app/javascript/activeadmin_addons/inputs/date-time-picker.js
activeadmin_addons_rails6-1.7.2 app/javascript/activeadmin_addons/inputs/date-time-picker.js
activeadmin_addons-1.7.1 app/assets/javascripts/activeadmin_addons/inputs/date-time-picker.js
activeadmin_addons-1.7.0 app/assets/javascripts/activeadmin_addons/inputs/date-time-picker.js