title: get clicked date in bootstrap-datepicker
body: <p>I try to get the date clicked in the bootstrap-datepicker. This is the code so far, I retrieve the date that is selected and not the date that is clicked. What do I need to change to get the clicked date?</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
      var disableDates = [&quot;1-3-2022&quot;, &quot;3-3-2022&quot;];
      $('#calendar').datepicker({
          format: 'yyyy/mm/dd',
          language: &quot;sv&quot;,
          beforeShowDay: function(date){
              dmy = date.getDate() + &quot;-&quot; + (date.getMonth() + 1) + &quot;-&quot; + date.getFullYear();
              if(disableDates.indexOf(dmy) != -1){
                  return false;
              }
              else{
                  return true;
              }
          },
          dayClick: function (date, jsEvent, view) {
              alert(&quot;Day Clicked&quot;);
          },
          eventClick: function (event) {
              alert('event');
          }
      });
  
  $(&quot;#calendar .datepicker-days&quot;).on('click', 'td.day', function () {
          let selecteddate = $(&quot;#calendar&quot;).data('datepicker').getFormattedDate('yyyy-mm-dd');
      alert('day clicked ' + selecteddate);
  });
  &lt;/script&gt;
  </code></pre>