title: How to get the date input from flatpickr?
body: <p>I am changing my jquery ui datepicker to flatpickr. But i need to know how i can do this <code>$('#from2').datepicker('getDate')</code> for flatpickr. I cant find it online how to do it with flatpickr.</p>
  
  <p>Thanks for your time.</p>
  
  <p><b>*EDIT</b></p>
  
  <pre><code>function getDays() {
      let start = $('#from1').datepicker('getDate'),
          end   = $('#to1').datepicker('getDate'),
          days  = (end - start) / 1000 / 60 / 60 / 24;
          if(days == 0 || days &gt; 0) {
      $('#howManyNights').val(days);
    }
      return days;
  }
  </code></pre>
  
  <p>*Doesnt work with flatpickr:</p>
  
  <pre><code>function getDays() {
      let start = $('#from1').val();
          end   = $('#to1').val();
          days  = (end - start) / 1000 / 60 / 60 / 24;
          console.log(days);
          if(days == 0 || days &gt; 0) {
      $('#howManyNights').val(days);
      }
      return days;
  }
  </code></pre>
  
  <p>days = Nan</p>