I want the date picker using js to show blocs of three months per year I mean if today is November to show month of October, November, and December
this is my code
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<p>Select Date: <input type="text" class="datepicker"></p>
<script>
$(document).ready(function () {
var today = new Date();
$('.datepicker').datepicker({
format: 'mm-dd-yyyy',
autoclose:true,
endDate: "today-1d",
minDate:"today+1d",
maxDate: "+2m"
}).on('changeDate', function (ev) {
$(this).datepicker('hide');
});
$('.datepicker').keyup(function () {
if (this.value.match(/[^0-9]/g)) {
this.value = this.value.replace(/[^0-9^-]/g, '');
}
});
});
</script>
this shows 2 months from now but I want it to be months form trimester of the year
I want the past dates to be disabled and only show in blocs of three months the date picker depending on the current date, example 4th July it's on the trimester of July-August-September