The library no longer works with jquery 3.0.0 or 3.1.0
Can you provide a jsfiddle? Which version of the library are you using?
look like it's because $.fn.size() method has been removed from jquery 3.x...
got that error: bootstrap-datetimepicker.min.js:formatted:1Uncaught TypeError: g.size is not a function
i'm using the latest version of both librarys
jquery = 3.1.0
bootstrap-datetime = version : 4.17.37
i'll try and put up a jsfiddle for you tomorrow... but in short the calendar never shows when you click either the calendar button or clicking on the input field so you can never see the date selector, also no errors were displaying this end
https://jsfiddle.net/ttz2m6xy/
apologies in advance if i've missed something out, but from the fiddle seems to be pointing to what Fox4305 is saying
I can confirm the same issue here.
I got bootstrap-datetimepicker from bower and it installed the latest jquery. (3.1.0) Inserting the sample code into a blank page yielded the following JS console error:
jQuery.Deferred exception: input.size is not a function TypeError: input.size is not a function
at dateTimePicker (https://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/src/js/bootstrap-datetimepicker.js:2254:23)
at HTMLDivElement.<anonymous> (https://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/src/js/bootstrap-datetimepicker.js:2309:46)
at Function.each (https://code.jquery.com/jquery-3.1.0.slim.js:368:19)
at jQuery.each (https://code.jquery.com/jquery-3.1.0.slim.js:157:17)
at jQuery.$.fn.datetimepicker (https://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/src/js/bootstrap-datetimepicker.js:2304:21)
at HTMLDocument.<anonymous> (https://fiddle.jshell.net/ttz2m6xy/show/:60:39)
at mightThrow (https://code.jquery.com/jquery-3.1.0.slim.js:3508:29)
at process (https://code.jquery.com/jquery-3.1.0.slim.js:3576:12) undefined
Uncaught TypeError: input.size is not a function
I rolled back jquery to 2.2.4 and the datepicker instantly worked.
i think there is a fix in place
https://github.com/Eonasdan/bootstrap-datetimepicker/pull/1664
we have a fix in place and hopefully will get merged https://github.com/Eonasdan/bootstrap-datetimepicker/pull/1726
I can also confirm this
How soon will this fix be available on NuGet?
No idea, just waiting for the next release but i have no idea when that will be
Can we get a hotfix in the meantime?
i'm not the owner of this library :), but theres plenty of approaches you can take if you can't wait for the patch. i don't personally recommend doing any of them and i would wait for the next release. but here goes:
This is my workaround for now:
Object.getPrototypeOf($('#one-of-the-date-pickers')).size = function() { return this.length; }; // Workaround for https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1714
But it would be good for the importance of a hotfix to come to @Eonasdan's attention.
yeah he's been mentioned a few times on the pr where the fix was initially please check here
https://github.com/Eonasdan/bootstrap-datetimepicker/pull/1726
dev is now master
Thank you
Thanks ! :)
I think Bower users (like me) waiting for version with fix too :)
Can confirm this is broken in ember 2.8+ which uses jQuery 3+
.datepicker is not working in jquery 3.1.1 version.. plz help me guys to get rid of this..
@Eonasdan Hi, does closing the issue mean that the library is compatible with jQuery 3.x now?
For bower users who are not aware, there is version 4.17.45 which works.
Most helpful comment
I think Bower users (like me) waiting for version with fix too :)