i'm quite newbie to javascript. I'm struggling to create a small code in order to my datepicker only show/allow to be selectable the months July, August and September.
I'm using this code right now:
<script type='text/javascript'>
jQuery.noConflict();
jQuery(document).ready(function($) {
$( "#input_7_13" ).datepicker({ dateFormat: 'dd/mm/yy',
minDate: 1, onChangeMonthYear: function(year, month, inst) {
if(month<5){
year = year-1;
$( this ).datepicker( "setDate" , new Date(year, 8, 1) )
$( this ).datepicker("refresh");
}
if(month>9){
year = year+1;
$( this ).datepicker( "setDate" , new Date(year, 6, 1) )
$( this ).datepicker("refresh");
}
}
});
});
</script>
So, if the month is lower than 5 (June) it takes a year and assumes the month 8 (September). If the month is greater than 89(October) it adds a year and assumes the month 9 (July).
This is working while going foward. If i try to go backwards, it will loop between July and May ...