Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there anyway to have a jquery UI date picker only allow saturdays?

I am using a jquery ui datepicker. I want to add some validation so it only allows people to choose Saturdays instead of any date.

I could validate after the fact but thought it would be slicker to have the datepicker do the upfront validation by only enabling Saturday dates.

like image 531
leora Avatar asked Jan 05 '11 13:01

leora


1 Answers

$("#test").datepicker(
    {
        beforeShowDay: function(date){
          if(date.getDay() == 6){
                return [true];
            } else {
                return [false];
            }
        }
    }
);
like image 152
Paté Avatar answered Oct 12 '22 22:10

Paté