Iβm working on a site for a client, on the site I use the JQuery UI Calendar , I need to be able to allocate 3 working days starting 2 days after the current date, but including math, so as not to count weekends. Here is my fiddle:
Js fiddle
Here is the HTML
<input type="text" id='datepicker'>
Here is js
var SelectedDates = {};
SelectedDates[new Date('04/14/2014')] = new Date('04/14/2014');
SelectedDates[new Date('04/15/2014')] = new Date('04/15/2014');
SelectedDates[new Date('04/16/2014')] = new Date('04/16/2014');
$('#datepicker').datepicker({
minDate: 2,
maxDate: "+4M +15D",
beforeShowDay: function (date) {
var Highlight = SelectedDates[date];
if (Highlight) {
return [true, "Highlighted", Highlight];
} else {
return [true, '', ''];
}
}
});
I am having trouble adding beforeShowDay: $.datepicker.noWeekendsto the code above. I also need 3 dates that are highlighted as variables, so they change depending on the current date, but I'm still learning JS, and I don't understand the logic of this.
I looked through this whole site and others, and although there are many questions / answers on how to highlight specific dates, none of them apply to what I'm trying to do.
, , , , , minDate .