Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
112
rated 0 times [  114] [ 2]  / answers: 1 / hits: 29444  / 8 Years ago, wed, july 27, 2016, 12:00:00

I have been trying to use bootstrap datetimepicker and have all the components on my scripts like Moment JS, bootstrap-date-time js, and bootstrap js but I am getting g.size() is not a function error. I am trying to run the following function





$(function(){
$('#datetimepicker').datetimepicker();
});




More From » jquery

 Answers
19

My solution was to find a different datetime picker that actually worked


I found this one: https://github.com/xdan/datetimepicker, it was quite easy to get working:



  1. download the zip from github



  2. Include the files :


    <link href="./js/datetimepicker-master/build/jquery.datetimepicker.min.css" rel="stylesheet">
    <script src="./js/datetimepicker-master/build/jquery.datetimepicker.full.min.js"></script>



  3. This HTML


    <input id="datetimepicker" type="text" />



  4. And this JS


    $.datetimepicker.setLocale('en');

    $('#datetimepicker').datetimepicker();




I got this up and working in a tiny fraction of the amount of time I'd wasted trying to get the bootstrap datetimepicker to stop giving me the g.size() error.


Of course there are many other datetime pickers available:


See this post for many more options : whats-a-good-javascript-time-picker


[#61236] Monday, July 25, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anitadevonm

Total Points: 730
Total Questions: 93
Total Answers: 74

Location: Estonia
Member since Wed, Jun 8, 2022
2 Years ago
;