ITsolutionWizard
asked on
JS Add Date
Inside of result var. I want to add days. like showing 01/01/2020
How can i do that in JS?
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>
ASKER
Just tried and not working to me
what error you have received?
what library you're using for your picker class?
what library you're using for your picker class?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
you need to include this function as well:
Open in new window