I need help to display list of dates which displays the date from 2 date forms.
Example :
- value of 1st date form is 25-06-2021
- value of 2nd date from is 28-06-2021
and will display like this :
<p>25 June 2021</p>
<p>26 June 2021</p>
<p>27 June 2021</p>
<p>28 June 2021</p>
I've try this
HTML
<input type="text" id="firstDate" name="firstDate"/>
<input type="text" id="secondDate" name="secondDate"/>
JQuery
$("#firstDate").datepicker({
});
$("#secondDate").datepicker({
onSelect: function () {
myfunc();
}
});
function myfunc(){
var start= $("#firstDate").datepicker("getDate");
var end= $("#secondDate").datepicker("getDate");
days = (end- start) / (1000 * 60 * 60 * 24);
alert(Math.round(days));
}
However, it only counts the number of days, doesn't display the date list.