I have the following Jquery ui datepicker setup. I want to highlight a specific date in the future, how can that be done?
I already have weekends disabled so that's adding extra complications using beforeShowDay
.
$('#mypicker').datepicker({
//options
minDate: now,
firstDay: 0,
format: "yyyy.mm.dd",
onSelect: function(dateText, inst) {
$('.new_ship_date').val(dateText);
},
beforeShowDay: $.datepicker.noWeekends,
});
This is the answer in another question but I can't work out how to combine that with the disable weekends function.
var your_dates = [new Date(2011, 7, 7),new Date(2011, 7, 8)]; // just some dates.
$('#whatever').datepicker({
beforeShowDay: function(date) {
// check if date is in your array of dates
if($.inArray(date, your_dates)) {
// if it is return the following.
return [true, 'css-class-to-highlight', 'tooltip text'];
} else {
// default
return [true, '', ''];
}
}
});