2

I'm wondering if there's a method or option in JQuery datepicker to disable days in the calendar, or even a way to perhaps disable days so that choosing a month is enough to set the date.

Can't seem to find anything that does the job @ http://api.jqueryui.com/datepicker/#option-navigationAsDateFormat

I have a non-paying client who requested this, so would rather keep on using the datepicker component rather than try and re-engineer an input (dual input asi t would be due to them needing MM/YY).

Any help with this could be considered my christmas and birthday gifts combined.

Cheers in advance!

3

2 Answers 2

2

you can refer http://davidwalsh.name/jquery-datepicker-disable-days to do hope it can help you

Sign up to request clarification or add additional context in comments.

Comments

0

You can use the beforeShowDate event of the datepicker combined with Date.getDay() to do what you want, like this:

​$("#datepicker").datepicker({
    beforeShowDay: function(date) {
        var day = date.getDay();
        return [(day != 1 && day != 2)];
    }
})​​​​​;​

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.