I wasn't sure if you want to just make the other months inactive or to hide them completely from the date picker, so I've included both options. The demo currently hides them completely.
var monthsToShow = ['May', 'Nov']; $('#example1').datepicker({ format: "MM yyyy", minViewMode: 1, autoclose: true }).on("show", function(event) { $(".month").each(function(index, element) { var el = $(element); // to make other months inactive use this: if ($.inArray(el.text(), monthsToShow) >= 0) el.removeClass('disabled'); else el.addClass('disabled'); // to hide inactive months use this: if ($.inArray(el.text(), monthsToShow) >= 0) el.show(); else el.hide(); }); });
Here's the fiddle: http://jsfiddle.net/awv3cx4x/