datetimepicker icon indicating copy to clipboard operation
datetimepicker copied to clipboard

Breaking Change on Update from 2.4.5 to 2.5.4 datetimepicker is not a function

Open isapir opened this issue 8 years ago • 9 comments

I upgraded datetimepicker from version 2.4.5 to version 2.5.4 but I'm getting an error saying that datetimepicker is not function.

Tested on most recent version of Chrome ATM: Version 53.0.2785.143 m (64-bit)

Is that a known issue? If so, is there an "Upgrade Guide"?

isapir avatar Oct 10 '16 21:10 isapir

I've got the same issue, after update, datetimepicker is not a function.

KevinHoughton avatar Oct 27 '16 09:10 KevinHoughton

Using the script-loader worked for me with v2.5.4 :+1:

import $ from 'jquery';
import 'script!jquery-datetimepicker';

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

juukie avatar Nov 09 '16 08:11 juukie

I had the same problem, my solution was moving the function call outside of the $( document ).ready()

jberculo avatar Nov 10 '16 16:11 jberculo

@jberculo But isn't $(document).ready() the place to set up such objects? Where do you set it up if not inside ready()?

isapir avatar Nov 10 '16 16:11 isapir

@isapir True. Maybe it has it's own on document ready? It could not be a real solution, and only be working because of the fact that these files are cached on my side already.

In the examples, the code seems to reside in a doc ready, although it is using an old version of jQuery. It's quite strange...

jberculo avatar Nov 10 '16 17:11 jberculo

Hi guys,

to solve the issue, take a look in the folder structure of the last version and the docs. The full library is located in the folder /build. Instead of load the jquery.datetimepicker.js and .css from the main path of the library, you can use the ones are in the folder /build (have sense to use them). Those files have the min version for js and css of the full library and load correctly the plugin.

The plugin use DateFormatter (Date formatter utility library that allows formatting date/time variables or Date objects using PHP DateTime format). The build version in /build includes this library, but the js in the main path do not.

cesiztel avatar Nov 14 '16 10:11 cesiztel

I was already using that version, but it does not make a difference in my case.

jberculo avatar Nov 14 '16 10:11 jberculo

Hi guys,

I have the same problem, and even loading the filesjquery-datetimepicker/build/jquery.datetimepicker.full.min.jsand jquery-datetimepicker/build/jquery.datetimepicker.min.css still the error continues in which it is not a function .

Someone to help?

saferrodrigo avatar Feb 27 '20 18:02 saferrodrigo

Hi guys,

I have the same problem, and even loading the filesjquery-datetimepicker/build/jquery.datetimepicker.full.min.jsand jquery-datetimepicker/build/jquery.datetimepicker.min.css still the error continues in which it is not a function .

Someone to help?

sorry

I managed to find my mistake

was loading the jquery.js file twice to the same place and maybe this was confusing the DOM

saferrodrigo avatar Feb 27 '20 19:02 saferrodrigo