Hi I have a issue with the jQuery datepicker.
Tried to search post but cannot get any solution yet. I am trying to implement the jQuery datepicker to disable specific date with the below code. But instead of disable that specific dates, I need the following is also disable. Let, if I disable 20-01-2016, the 21-01-2016 will also automatic disabled.
Anyone can help please?
var disabledDays = ["8-5-2016","8-25-2016"]; function nationalDays(date) { var m = date.getMonth(), d = date.getDate(), y = date.getFullYear(); for (i = 0; i < disabledDays.length; i++) { if($.inArray((m+1) + '-' + d + '-' + y,disabledDays) != -1 || new Date() > date) { return [false]; } } return [true]; } function noWeekendsOrHolidays(date) { var noWeekend = jQuery.datepicker.noWeekends(date); return noWeekend[0] ? nationalDays(date) : noWeekend; } $( "#step3a" ).datepicker({ showButtonPanel: true, changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", minDate: +2, beforeShowDay: noWeekendsOrHolidays });