input date new date code example
Example 1: set date input html using js
document.getElementById("datePicker").valueAsDate = new Date()
Example 2: html date input
<label for="start">Start date:</label>
<input type="date" id="start" name="trip-start"
value="2018-07-22"
min="2018-01-01" max="2018-12-31">