Disable all dates except a list of specific dates using MultiDatesPicker

1.5k Views Asked by At

I'm using MultiDatesPicker for jQuery UI.

I have a list of dates and I want to enable only those dates and disable all others.

var a = ['11.11.11', '11.12.12', '11.12.13'];

$('.dates').multiDatesPicker({
    dateFormat: "dd.mm.y",
    beforeShowDay: function(a){
        _.each(a, function(date){
            return date ? [true, ''] : [false, '']
        })
    },
    separator: '.',
    maxPicks: 1,
});

This is not working. How can I accomplished this?

1

There are 1 best solutions below

2
jacman On

Did you tried the example in the doc ?

http://dubrox.github.io/Multiple-Dates-Picker-for-jQuery-UI/#demo-disable-dates

It seems that you have to pass an array of dates and not an array of strings.