I have two different dates inputs with HTML5 calendar One of it start date and the second is end date I just need to compute the days when the user selects start date and end date using javascript and use if condition for example if these days great than 10 hide some elements
var date1 = new Date($('#start').val());
var date2 = new Date($('#end').val());
var timeDiff = Math.abs(date2.getTime() - date1.getTime());
var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
alert(diffDays);
start
<br />
<input id="start" type="date" data-date-inline-picker="true" />
<br />
end
<br />
<input id="end" type="date" data-date-inline-picker="true" />
<br />
<div id="demo">the days here</div>