tailor
tailor

Reputation: 376

jquery datepicker calendar how to disable sunday date or any day?

I am working on hrm related site I have face one problem that uploading attending sheet select jquery date picker calender date. In calander require not select sunday date for upload attendance sheet.

please help how to disable sunday date in jquery datepicker ?

Upvotes: 3

Views: 16502

Answers (2)

Sarcastic
Sarcastic

Reputation: 687

You have to use beforeShowDate event of DatePicker like below:

$("#textboxid").datepicker({
beforeShowDay: function(date) {
var day = date.getDay();
return [day != 0,''];
}
})​​​​​;​

Upvotes: 8

Nibin
Nibin

Reputation: 3960

Hope something like this may help u mate... :)

$('#noSunday').datepicker({ 
        beforeShowDay: noSunday, 
 }); 

      function noSunday(date){ 
         return [date.getDay() != 0, ''];
      }; 

Fiddle

http://jsfiddle.net/zXFGN/

Upvotes: 6

Related Questions