jqueryui daterangepicker可在chrome和Firefox中使用,但不能在safari中使用

时间:2018-09-26 17:37:13

标签: jquery jquery-ui safari daterangepicker

在野生动物园中应如何看待: chrome interface

它在野生动物园中的外观如何: safari interface

控制台中没有错误,但是,在检查器中,我可以看到Safari缺少组成日历的“ .table-condensed”元素。我还尝试注释掉$('#daterangepicker')。daterangepicker()以外的所有内容,后者似乎也没有任何作用。

铬:web inspector in chrome

SAFARI:web inspector in safari

这是我的代码(Pug / JS):

input(type="text" id="daterangepicker" name="daterange")
  script.
    $('#daterangepicker').daterangepicker({
        "timePicker": false,
        "opens":"center",
        "alwaysShowCalendars": true,
        "showDropdowns": true,
        "startDate": "04/16/1996",
        "endDate": "07/06/2018",
        "linkedCalendars":false
    }, function(start, end, label) {
      console.log("New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')");
      timeline.setWindow(start, end);
    });
    $('#daterangepicker').on('apply.daterangepicker', function(ev, picker) {
      //do something, like clearing an input
      ev.preventDefault();
      console.log("make sure this is working");
      var input = $('#daterangepicker');
      input.focus();
      input.select();

      var input2 = $('.daterangepicker');
      $("#daterangepicker").after(input2);
    });
    $('#daterangepicker').keyup(function(e){
        if(e.keyCode == 13)
        {
            console.log("custom keyup working");
            e.preventDefault();
            console.log("make sure this is working");
            var input = $('#daterangepicker');
            input.focus();
            input.select();

            var input2 = $('.daterangepicker');
            $("#daterangepicker").after(input2);
            $(this).trigger("enterKey");
        }
    });

0 个答案:

没有答案