1

I am able to set the value to a certain amount of days past the current day, like so:

$(function () {
    $("#PriorityLevelID").on("change", function() {
        $("#DueDate").datepicker("setDate", 2);
    });
});

But is there a way to exclude weekends? For example, 2 days past Friday would not be Sunday, it would be Tuesday in business days.

mdk09
  • 287
  • 1
  • 4
  • 17
  • `$(".selector").datepicker({ beforeShowDay: $.datepicker.noWeekends })` – Howard Renollet Oct 22 '14 at 19:12
  • 1
    @HowardRenollet This does not work. It excludes weekdays from being displayed on the calendar, yes, but when adding days to the current date, it still includes them. – mdk09 Oct 22 '14 at 19:16
  • The easiest thing would be to check and see if the day you want to select (prior to selecting it) returns 0 or 6 from getDay() which would mean that it's a Saturday (6) or Sunday (0) and then adjust as needed. Otherwise you'd probably have to mess around with beforeShowDay(). – j08691 Oct 22 '14 at 20:33

0 Answers0