red one
red one

Reputation: 182

using twitter datepicker.css and bootstrap-datepicker.js

I am trying to create a datepicker using twitter datepicker.css and bootstrap-datepicker.js but it's not working. I'm using codeigniter in this project.

<input type="text" name="end_date" value="" class="datepicker" data-format="dd-MM-yyyy" />  

<script>
    $(function() {
        $( ".datepicker" ).datepicker();
    });
</script>

I've included both the files mentioned above but this is not working. How can I make it work?

I have a Error(Firebug) --> "TypeError: $(...).datepicker is not a function"

Upvotes: 0

Views: 4676

Answers (2)

Chtioui Malek
Chtioui Malek

Reputation: 11515

You can can use : http://www.eyecon.ro/bootstrap-datepicker/

$(function() {
  $(".datepicker").datepicker({format:'dd/mm/yyyy'});
});

here's a working example : https://refork.codicode.com/x771

Upvotes: 2

Nathan
Nathan

Reputation: 3190

red one,

It would be helpful to share a jsFiddle of your code. At least let us know what scripts you are loading and styles you are loading and in which order. Since the datepicker is dependent on jQuery you need to make sure that jQuery is loading before your .js files. You asked about the bootstrap-responsive and bootstrap files. As long as you are linking to the correct one it should work.

Hopefully that gives you a little direction. Will update when you share more information.

Upvotes: 0

Related Questions