Tony Tony - 8 months ago 110
Javascript Question

Jquery datepicker enable dates from array?

I am trying to enable just some specified dates in datepicker. In my case the values inside the variable "onlyThisDates".
Should I use enabledDates option to solve this or ..?
I do not want disable the values in the array. The other way around. I want disable everything and just enable the values in the array.

If someone could help it would be great.

<input id="openDatepick></input>




var onlyThisDates = ['09/11/2015', '10/11/2015', '11/11/2015'];

var nowDate = new Date();
var today = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate(), 0, 0, 0, 0);

$('#openDatepick').datepicker({
format: 'dd/mm/yyyy',
startDate: today

}).on('changeDate', function (e) {
//$('this').datepicker('hide');
});
$("#remove").on("click", function () {
$('.datepicker-days').hide();
});

Answer Source
@Tony Please Try This -- it will enable only specific dates in bootstrap 
datepicker

http://jsfiddle.net/vCJ2u/198/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download