bootstrap-datepicker icon indicating copy to clipboard operation
bootstrap-datepicker copied to clipboard

multidate not working when using setDate

Open hfar opened this issue 11 years ago • 1 comments

i am unable to select multiple date when using setDate along with multidate.

for example:

var dateAdded = ["2015-07-15","2015-07-17"];
     var dates = [];
                $.each(dateAdded, function(i, dateStr){
                    var d = new Date();
                    var dateArray = dateStr.split("-");
                    d.setFullYear(parseInt(dateArray[0]));
                    d.setMonth(parseInt(dateArray[1])-1);
                    d.setDate(parseInt(dateArray[2]));
                    dates.push(d);
                });

$(element).datepicker("setDates",dates);

above code will setDates ,when trying to select other dates the above dates will get unselected and the multiselect will not work ,you can just select one date at a time.

hfar avatar Jul 28 '15 14:07 hfar

my bad the option multidate was only sent on attrs.$observe but not when loading the angular directive,i just added the option when loading the directive.

hfar avatar Jul 28 '15 15:07 hfar