1

I think my problem is simple and perhaps not directly related to the component of Richardson.

TypeError: $ (...). DateTimePicker is not a function

jsFiddle: http://jsfiddle.net/bassvix/NUA6v/

Was added all the references of the Richardson´s sample page but still does not work. http://trentrichardson.com/examples/timepicker/ # basic_examples

Copied the source code from one example.

HTML:

<div>
    <input class="hasDatepicker" name="slider_example_4" id="slider_example_4" value="" type="text">
</div>

Scripts: (console.log for display finded control)

console.log ($ ('# slider_example_4'));

$ ('# slider_example_4'). datetimepicker({
controlType: 'select',
timeFormat: 'hh: mm tt'
});
RichardsonVix
  • 23
  • 1
  • 7

1 Answers1

3

Do not add: class="hasDatepicker" to the input. This is done by the datetimepicker JavaScript itself.

Your fiddle doesn't work because you cannot pull the JS and CSS files from trentrichardson.com remotely.

See this fiddle: http://jsfiddle.net/mccannf/2Kp56/1/

mccannf
  • 16,619
  • 3
  • 51
  • 63
  • I have to test before using and not using class="hasDatepicker" and doesn´t. I have to do other test using only: And $("#datetimepicker").datetimepicker( { controlType: 'select', dateFormat: "dd/mm/yy", timeFormat: 'HH:mm' } ); And works, but when using in my project doesnt work. In some test I found a direction of the problem, some conflict with Globalize and Wijmo. – RichardsonVix May 03 '13 at 11:30
  • In some tests I found a direction of the problem, some conflict with Globalize and Wijmo. Also find this post, [link](http://stackoverflow.com/questions/8678254/datetimepicker-is-not-a-function-jquery) confirm my suspicion. But not works yet. – RichardsonVix May 03 '13 at 11:56