开发者

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 Saturday开发者_如何学Cs 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.


$("#test").datepicker(
    {
        beforeShowDay: function(date){
          if(date.getDay() == 6){
                return [true];
            } else {
                return [false];
            }
        }
    }
);


beforeShowDay: function (date) {

    /* your other function code here */

    if (date.getDay() == 6) {
        return [true, ''];
    } else {
        return [false, ''];
    }
}

Similar questions:

  • JQuery Datepicker - only select mondays and thursdays
  • jQuery UI Datepicker - allow only certain weekdays
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜