- Fri Jun 22, 2018 10:16 am
#814876
Hi to everyone,
I have two datepickers (beginning date and end date) on a dynaform and the idea is that in the moment where the user pick a beginning date, the end date automatically sets one day after that (it doesn't matter if is a weekend). I tried with this code but i can't make it work.
Thanks you.
I have two datepickers (beginning date and end date) on a dynaform and the idea is that in the moment where the user pick a beginning date, the end date automatically sets one day after that (it doesn't matter if is a weekend). I tried with this code but i can't make it work.
Code: Select all
function setEndDate(startDate, days) {
var end = moment(startDate);
end = add(days, 'days');
$("#date_end").setValue(end);
}
setEndDate($(#date_begin").getValue(), 1);
$("#date_begin").setOnchange(setEndDate);
Thanks you.