Bootstrap Datetime Picker not working with Bootstrap 4 Alpha 6

后端 未结 2 558
别那么骄傲
别那么骄傲 2020-12-19 09:44

We are using Eonasdan Datetime picker. We are migrated to Boostrap 4 Alpha 6 since it comes with lot of improvements over Alpha5 but Datetime picker broken. Now it\'s not sh

2条回答
  •  眼角桃花
    2020-12-19 10:08

    Classes collapse in classes were changed into collapse show, that's why the code became incompatible.

    in your vendor\eonasdan\bootstrap-datetimepicker\src\js\bootstrap-datetimepicker.js

    getTemplate:

    if (hasDate()) {
     content.append($('
  • ').addClass((options.collapse && hasTime() ? 'collapse in' : '')).append(dateView));
  • Change to:

    if (hasDate()) {
      content.append($('
  • ').addClass((options.collapse && hasTime() ? 'collapse show' : '')).append(dateView)); }
  • togglePicker:

       expanded = $parent.find('.in'),
      closed = $parent.find('.collapse:not(.in)'),
    

    and

       } else { // otherwise just toggle in class on the two views
         expanded.removeClass('in');
         closed.addClass('in');
    

    Change to:

     expanded = $parent.find('.show'),
     closed = $parent.find('.collapse:not(.show)'),
    

    and

      } else { // otherwise just toggle in class on the two views
      expanded.removeClass('show');
     closed.addClass('show');
    

    Source

提交回复
热议问题