Date with bootstrap does not run on my project

2

I need to put a component to select dates in a filter in my project. As I use bootstrap, I need to put the dates with this component. It turns out that the examples I got on the internet, I could not make it work, one of them here

Any help, thank you.

I put this face in my .js

$('.datepicker').datepicker()

And this in my view without the value, with no default date.

<div class="input-append date" id="dp3" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
  <input class="span2" size="16" type="text" value="12-02-2012">
  <span class="add-on"><i class="icon-th"></i></span>
</div>
    
asked by anonymous 03.10.2014 / 15:25

1 answer

1

According to your command:

$('.datepicker').datepicker()

If you're exactly as you said, you need to add the css class datepicker to your input .

<input class="span2 datepicker" size="16" type="text" value="12-02-2012">

Otherwise jQuery does not find the element to then apply the plugin.

    
03.10.2014 / 18:45