I'm following behind another coder and have never used jQuery's Datepicker before, and I am somewhat lost... and not very good at this in the first place. I've been asked to disable all Sundays in Datepicker so people can't select those days for appointments, but all the original coder left me was:
jQuery('#date-needed').datepicker({
minDate: 0,
maxDate: '+14d'
});
I know this means that people can't make appointments outside of two weeks from the day they make them, but that's about it. There must be a simple(ish) way to solve this, but nothing I've tried has blacked out the Sundays, and most methods seem to break the widget altogether. Help!
What I have tried:
I've tried simple things, like adding
daysOfWeekDisabled: [0]
and...
WeekdaysDisabled: [0]
and I got a little fancier and tried to make a function...
JQuery('#date-needed').datepicker({
minDate: 0,
maxDate: '+14d'
});
JQuery('#date-needed').ready(function() {
$(function() {
$(".datepicker").datepicker({
dateFormat: 'dd-mm-yy',
beforeShowDay: my_check
});
});
function my_check(in_date) {
if (in_date.getDay() == 0) {
return [false, "notav", 'Not Available'];
} else {
return [true, "av", "available"];
}
}
});
...and about a dozen other iterations... I obviously need to brush up on my coding in a big way (I know there are... so many problems there), but if anyone has any suggestions as to how I can fix this, I'd greatly appreciate it!