I'm working on a hotel website, complete with reservation tool and I need to make one last change to the integrated datepicker.
Currently the code has been modified to allow for Saturday check-ins only.
I need to make a further modification to enable only April, May, June, July, August, September.
Can anybody show me how to add a getMonth to this existing code to achieve the above?
Here is the existing:
$.fn.gdlr_datepicker = function(){
$(this).datepicker({
dateFormat : 'yy-mm-dd',
minDate: 0,
changeMonth: true,
changeYear: true,
closeText: objectL10n.closeText,
currentText: objectL10n.currentText,
monthNames: objectL10n.monthNames,
monthNamesShort: objectL10n.monthNamesShort,
dayNames: objectL10n.dayNames,
dayNamesShort: objectL10n.dayNamesShort,
dayNamesMin: objectL10n.dayNamesMin,
firstDay: objectL10n.firstDay,
beforeShowDay: function(date) {
var date1 = $.datepicker.parseDate('yy-mm-dd', $("#gdlr-check-in").val());
var date2 = $.datepicker.parseDate('yy-mm-dd', $("#gdlr-check-out").val());
return [date.getDay() === 6, date1 && ((date.getTime() == date1.getTime()) || (date2 && date >= date1 && date <= date2)) ? "dp-highlight" : ""];
},
});
Thanks in advance.