0

https://drive.google.com/file/d/1XDXDKO2CjwBkBZEbY0PwGcx1S3gVXCiN/view?usp=sharing

<div class="col-lg-6">
  <label>Check-In</label>
  <input type="date" name="checkin" class="form-control" id="checkin" />
</div>

<div class="col-lg-6">
  <label>Check-Out</label>
  <input type="date" name="checkout" class="form-control" id="checkout" />
</div>
Gary
  • 13,303
  • 18
  • 49
  • 71
  • 4
    Does this answer your question? [How do I get the number of days between two dates in JavaScript?](https://stackoverflow.com/questions/542938/how-do-i-get-the-number-of-days-between-two-dates-in-javascript) – Umair Khan Jul 21 '20 at 05:26

1 Answers1

0

Use below:

var checkin = $("#checkin").val();
var checkout = $("#checkout").val();
if(checkout >= checkin) {
    var diffTime = Math.abs(checkout - checkin);
    var days = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
} else {
    //logic error
}
iman kazemi
  • 522
  • 5
  • 15