date with difference of day according to the selection

hello I wish my client can select two date but be spaced two days

example:

in the first (datepicker1) he selects the 11/05/2019 in the (datepicker2) he can select from 13/05/2019 because two working days between each date

I found this code in the forum but the problem is that there is no action that happens

could you help me?

function addDays(days) {
var date = new Date(); // today
date.setDate(date.getDate() + days); return date;
}

$w(" # datepicker1").minDate = addDays(0);
$w(" # datepicker2").maxDate = addDays(+2);

hi,

try adding these two lines inside the onReady event handler

$w(" #datepicker1 “).minDate = addDays(0);
$w(” #datepicker2 ").maxDate = addDays(2);

Hello

sorry i started in the code i did that but no reaction yet sorry to bother you

function addDays(days) {
var date = new Date(); // today
date.setDate(date.getDate() + days); return date;
}

$w.onReady( function () {
$w(“#datePicker1”).minDate = addDays(0);
$w(“#datePicker2”).maxDate = addDays(2);
} );

hello dos inbar

if you had seen my post or I had to create a new post in the forum