Tempus-dominus: No longer works with jquery 3.0.0 or 3.1.0

Created on 3 Aug 2016  路  21Comments  路  Source: Eonasdan/tempus-dominus

The library no longer works with jquery 3.0.0 or 3.1.0

Most helpful comment

I think Bower users (like me) waiting for version with fix too :)

All 21 comments

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.

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:

  1. Use jquery 2.1.4 or any of the jquery libs before 3++ and wait till 4.17.42 or greater is launched
  2. Make the changes locally on your own version of the library and replace once the new library has launched
  3. Download the development version of the library which has the fix in place (don't recommend this to highly as the development branch could be unstable)

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

callum-resdiary picture callum-resdiary  路  4Comments

benbhale picture benbhale  路  5Comments

brunoDegaspare picture brunoDegaspare  路  3Comments

y2kim picture y2kim  路  5Comments

woohling picture woohling  路  4Comments