Inside of result var. I want to add days. like showing 01/01/2020
How can i do that in JS?
<script> window.addEventListener("load", function () { // target input picker.attach("arrivaldate"); picker.attach("departuredate"); let today = new Date().toLocaleDateString(); var result = new Date().toLocaleDateString().toString("MM/dd/YYYY"); //alert(date.addDays(5)); this.document.getElementById("arrivaldate").value = today; this.document.getElementById("departuredate").value = result; });</script>
Open in new window
you need to include this function as well:
Open in new window