Hello every body
Sorry, i am a beginner..
I have 2 datepickers...one for Departure date and one for return date.
I would like add 7 days when Departure date is change
I can't do simple do this ?
$w("#departure").value= $w("#return").value + 7
I don't find the solution
Thanks for your help
Amazing, it is working ! Thanks a lot and take care of you
Add this function to your code:
Date.prototype.addDays = function(days) { var date = new Date(this.valueOf()); date.setDate(date.getDate() + days); return date; }
than you can simply write
$w("#departure").value = $w("#return").value.addDays(7);
Check here
https://www.w3schools.com/js/tryit.asp?filename=tryjs_date_ahead