BootStrap : Uncaught TypeError: $(...).datetimepicker Is Not A Function


Answer :

You are using datetimepicker when it should be datepicker. As per the docs. Try this and it should work.

<script type="text/javascript">   $(function () {     $('#datetimepicker9').datepicker({       viewMode: 'years'     });   });  </script> 

I had the same problem, you have to load first the Moment.js file!

<script src="path/moment.js"></script> <script src="path/bootstrap-datetimepicker.js"></script>


This is a bit late but I know it will help someone:

If you are using datetimepicker make sure you include the right CSS and JS files. datetimepicker uses(Take note of their names);

https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.css

and

https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js

On the above question asked by @mindfreak,The main problem is due to the imported files.


Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable