Hi,
Is it possible to dynamic update Range’s max date after user click a start date?
I want to limit users only can pick the end date within 10 days after they choose the start date.
I tried to set the new max date throw option after I get the start date on onDayChange event.
But the user always stuck in “select start date mode”. Does anyone have same issues?
Thanks.
onDayChange: function (event, inst) {
// Your custom event handler goes here
var format = 'YYYY/MM/DD';
console.log(event.active,moment(event.date).format(format));
switch(event.active){
case 'start':
var min_date = moment(event.date).format(format)
var max_date = moment(event.date).add(10,'d');
inst.option({
// min:min_date,
max:max_date
});
// inst.setVal([min_date,max_date]);
// inst.setActiveDate('start');
break;
case 'end':
console.log(inst.getVal());
break;
}
}