disable 3 months in calendar jquery

disable 3 months in calendar jquery

by Intesar Haider

HTML

<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<div style="font-weight: bold;">Disable Future Dates</div>
<div id="calendar123"></div>

JavaScript

jQuery(function() {		
		var date = new Date();
		var currentMonth = date.getMonth();
		var currentDate = date.getDate();
		var currentYear = date.getFullYear();
		
		$('#calendar123').datepicker({
			minDate: new Date(currentYear, currentMonth-3, currentDate),
			maxDate: new Date(currentYear, currentMonth+3, currentDate)
		});
	});