title: jquery bootstrap datepicker click event just firing once
body: <p>I have the following code
  (i am using the following bootstrap datepicker : <a href="http://www.eyecon.ro/bootstrap-datepicker/" rel="nofollow">http://www.eyecon.ro/bootstrap-datepicker/</a>)</p>
  
  <p>The datepicker must be closed when you click on a day. (not the changedate event because a moth of year can also be changed)</p>
  
  <p>everything works fine for just one time.
  The function is just firing once.</p>
  
  <p>Also I want to retrieve the date from the datepicker</p>
  
  <p>How can you achieve this</p>
  
  <pre><code>(function () {
      var setDate = $('_Date').val();
      //$('#_datepicker').datepicker('setValue', now);
      $('#_datepicker').datepicker('setValue', setDate);
  
      $('#_Date').change(function () {
      setDate = $('#_Date').val();
      $('#_datepicker').datepicker('setValue', setDate);
      console.log('day2');
  });
  
  })(jQuery)
  
  $(function () {
      $('.datepicker-days td.day').click(function (e) {
          e.preventDefault();
          console.log('day');
          //$('#_datepicker').datepicker('hide');
  
          //alert($('#_datepicker').getDate());
  
          //return false;
      });
  });
  </code></pre>
  
  <p>HTML / ASPX:</p>
  
  <pre><code>&lt;div class="col-sm-2" runat="server" id="block_date"&gt;
    &lt;div class="input-group input-append date" id="datepicker_addcase" data-date="12-02-2012" data-date-format="dd-mm-yyyy"&gt;  
    &lt;asp:TextBox runat="server" ID="cn_Date" CssClass="form-control" type="date-local" placeholder="Date" Text="Date"&gt;&lt;/asp:TextBox&gt;
                                      &lt;div class="input-group-addon"&gt;
                                          &lt;span class="glyphicon glyphicon-calendar add-on"&gt;&lt;/span&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
  </code></pre>