Gopal Chandak
Gopal Chandak

Reputation: 385

datetime picker not working . cant understand how to write the js

I am using bootstrap3 datetimepicker.I got the documentation from

https://eonasdan.github.io/bootstrap-datetimepicker/

Its says

Note All functions are accessed via the data attribute e.g. $('#datetimepicker').data("DateTimePicker").FUNCTION()

What is its meaning.I cant understand it.

My js file containes this code

 <script type="text/javascript">
            $(function () {
                $('#datetimepicker3').datetimepicker({
                    format: 'LT'
                });
            });
        </script>

What changes should i make in this. Please help me

Upvotes: 0

Views: 945

Answers (1)

Amy Barrett
Amy Barrett

Reputation: 614

Its says

Note All functions are accessed via the data attribute e.g. >$('#datetimepicker').data("DateTimePicker").FUNCTION()

What is its meaning.I cant understand it.

This is referring to the datetimepicker functions, rather than options - it isn't required to get the datetimepicker to work.

If you look at the 'Linked Pickers' example, you will see they have used these two lines to modify the min/max dates of the two datetimepickers:

$('#datetimepicker7').data("DateTimePicker").minDate(e.date);

$('#datetimepicker6').data("DateTimePicker").maxDate(e.date);

Your js looks okay to me, so it's likely a problem in your HTML or your import. If you press F12 and look at the console output, you should be able to see any js errors - this might help to debug where the problem is.

Upvotes: 1

Related Questions