setDates for 3 months for bootstrap multidate picker

181 Views Asked by At

How can I set pre-selected 3 months date prior to today in bootstrap multidate picker?
How to set 3 months into the option setDates option?
this link is only to set multi-date select and set only random 2 dates pre-selected, so it is not useful

1

There are 1 best solutions below

1
fernando On

you can try this to get your date (it's for 30 days ahead so you need to change it for 3 months):

var time = new Date();
time.setDate(time.getDate()+30);
alert(time);

and play with this to set up your new date:

$('#datepicker2').datepicker('setDate', new Date(2014, 2, 5));