BootStrap : Uncaught TypeError: $(...).datetimepicker is not a function
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.
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>