Sha256: b31c43d45b7be4f791495d73f040d095f969bcd92202134b48d4f24be0084069

Contents?: true

Size: 806 Bytes

Versions: 7

Compression:

Stored size: 806 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 turbo:load', initializer);

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
activeadmin_addons-2.0.0.beta.4 app/javascript/activeadmin_addons/inputs/date-time-picker.js
activeadmin_addons-1.10.2 app/javascript/activeadmin_addons/inputs/date-time-picker.js
activeadmin_addons-2.0.0.beta.3 app/javascript/activeadmin_addons/inputs/date-time-picker.js
activeadmin_addons-1.10.1 app/javascript/activeadmin_addons/inputs/date-time-picker.js
activeadmin_addons-2.0.0.beta.2 app/javascript/activeadmin_addons/inputs/date-time-picker.js
activeadmin_addons-2.0.0.beta.0 app/javascript/activeadmin_addons/inputs/date-time-picker.js
activeadmin_addons-1.10.0 app/javascript/activeadmin_addons/inputs/date-time-picker.js