Error With Bootstrap 3 Date/Time Picker

前端 未结 3 657
谎友^
谎友^ 2020-12-16 11:29

I am using the date/time picker from Eonasden that you can find here. Date Time Picker

I am using HTML from the example:

相关标签:
3条回答
  • 2020-12-16 11:42

    I found wrapping your code in

    $( document ).ajaxStop( function() {});
    

    fixed it for me

    0 讨论(0)
  • 2020-12-16 11:48

    According to the examples, you need to include this to..

    http://momentjs.com/

    It has to be after bootstrap.js, but before the datetimepickerjs like this..

    <script type="text/javascript" src="scripts/bootstrap.min.js"></script>
    <script type="text/javascript" src="scripts/moment-2.4.0.js"></script>
    <script type="text/javascript" src="scripts/bootstrap-datetimepicker.js"></script>
    

    It shows it on the GitHub readme..

    "Datetimepicker requires moment.js."

    0 讨论(0)
  • 2020-12-16 11:48

    Simple solution

    Once even I got the same error. I was able to fix that by including the content delivery network or content distribution network (CDN) link of the script file.

    Try the code below:

    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.js"></script>
    

    Include the above code before adding-in the bootstrap-datetimepicker.js

    0 讨论(0)
提交回复
热议问题