datetimepicker
datetimepicker copied to clipboard
jquery.datetimepicker.js:1760 Uncaught TypeError: Cannot read property 'formatDate' of null at jquery.datetimepicker.js:1760
Hello, everyone. I searched the issues and found issue #573, has the solution to solve this. However, after applying the solution, the style of html is totally abnormal. My code is like this:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link ref="stylesheet" type="text/css" href="source/jquerydatetimepicker/jquery.datetimepicker.css">
</head>
<body>
<input id="datetimepicker" type="text" >
</body>
<script src="source/jquery-3.1.0.js"></script>
<script src="source/moment.js"></script>
<script src="source/jquerydatetimepicker/jquery.datetimepicker.js"></script>
<script>
$.datetimepicker.setDateFormatter({
parseDate: function (date, format) {
var d = moment(date, format);
return d.isValid() ? d.toDate() : false;
},
formatDate: function (date, format) {
return moment(date).format(format);
},
});
$('#datetimepicker').datetimepicker();
</script>
</html>
Here is the source code. And it looks like this:

the solution on me does worst, the data is all weird, visualization is fine by the way
The workaround also does not work properly for me. As with @ramwin's screenshot, the minutes are shown as "i". I think this project is dead. I'm now going to use this one myself.
Another good alternative might be this: https://github.com/flatpickr/flatpickr
I switched from this project to date range picker, you can set singleDatePicker as true, then it works like a datetimepicker.
I also met this issue, the solution was to include "jquery.datetimepicker.full.js" instead of "jquery.datetimepicker.js".
@monlouisj nailed it
@monlouisj thanks!
@monlouisj thanks...
I also met this issue, the solution was to include "jquery.datetimepicker.full.js" instead of "jquery.datetimepicker.js".
I changed my code using jquery.datetimepicker.full.js but the html is still broken. Here is the code.
I also met this issue, the solution was to include "jquery.datetimepicker.full.js" instead of "jquery.datetimepicker.js".
This saved me from 4 hours of searching and implemening different things. Cheers
I also met this issue, the solution was to include "jquery.datetimepicker.full.js" instead of "jquery.datetimepicker.js".
I changed my code using
jquery.datetimepicker.full.jsbut the html is still broken. Here is the code.
You can write $.datetimepicker.setDateFormatter('moment'); instead of $.datetimepicker.setDateFormatter be sure it work!
I try to use jquery.datetimepicker.full.min.js and still ok, looks like we all that wrong. we use the file on the main dir instead of on the build directory?
Let's wait the maintainer to confirm this, I did like to suggest to explicitly note this on the documentation, so the future user won't end up on this kind of errors.
@Alru33 thank you.. I spent too long looking at the source code and your line solved my problem.
I also met this issue, the solution was to include "jquery.datetimepicker.full.js" instead of "jquery.datetimepicker.js".
my man
I just got this problem. And i solved it by following these steps on this page - the demo section. https://www.jqueryscript.net/time-clock/Clean-jQuery-Date-Time-Picker-Plugin-datetimepicker.html it work for me 🗡️
I also met this issue, the solution was to include "jquery.datetimepicker.full.js" instead of "jquery.datetimepicker.js".
my man
This is the solution. jut in case
I also met this issue, the solution was to include "jquery.datetimepicker.full.js" instead of "jquery.datetimepicker.js".
Thank you so much, you are a life saver