I am trying to select multiple dates in Boostrap-Datepicker.
I have intialized the datepicker as such, just fine.
$('#datepicker2').datepicker();
Now I want to select multiple dates on the calendar:
$('#datepicker2').datepicker('setDate', [new Date(2014, 2, 5),new Date(2014, 3, 5)]);
It's not working. No errors are logged but the dates are not selected.
EDIT: the datepicker version I used had some issue with multidates, I used a previous version and it works - probably a version issue
This works just fine though:
$('#datepicker2').datepicker('setDate', new Date(2014, 2, 5));
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…