django-bootstrap-datepicker-plus icon indicating copy to clipboard operation
django-bootstrap-datepicker-plus copied to clipboard

Unable to change options of datetimepicker within javascript

Open jasonhoward64 opened this issue 6 years ago • 2 comments

I'm attempting to change an option within the datetimepicker as a result of some user action, but I can't access the datetimepicker in javascript in the way that essentially 100% of sites recommend, which is the following:

 $(document).ready(function() {
    $('.input-group').datetimepicker({    
          console.log('I can now change options');
    });
 });

With the code above, the console.log statement never gets written. Is '.datetimepicker' the correct object to reference within django-bootstrap-datepicker-plus?

Thanks for your help!

jasonhoward64 avatar Feb 05 '19 21:02 jasonhoward64

The date-picker is bound to the input element. So you need to use selector $('.input-group>input').

monim67 avatar Feb 06 '19 06:02 monim67

Thanks. I'll give this a try!

jasonhoward64 avatar Feb 16 '19 23:02 jasonhoward64