Disable months in Datepicker

by Faisal Khan Janjua

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
Date Picker on input field: <input type="text" name="date" />

CSS

#ui-datepicker-div { font-size: 12px; }

JavaScript

$('input').datepicker({
    beforeShowDay: function(date){
    		if(date.getMonth() === 0 || date.getMonth() === 1 || date.getMonth() === 2 || date.getMonth() === 3 || date.getMonth() === 4 || date.getMonth() === 5){
        	return [true];
        }
        return [false]
    }
});