JQuery date picker - Disable weekends

Created by
Tuesday, July 12, 2016

 

In many cases there are business requirements in which we need to disable weekend selection on JQuery UI datepickers. This is simple to achieve.

$(function() {
   $('#txtDate').datepicker({ 
       beforeShowDay: $.datepicker.noWeekends 
   });
});

You will no see in the image below that saturday and sunday selections have been disabled.

Tags:
jquery
js
0
Rating
1 2 3 4 5

Save

Saved

Report

Reported
Reasons
Cancel
0 comments