Created
February 20, 2012 15:48
-
-
Save SamWM/1869756 to your computer and use it in GitHub Desktop.
jQuery UI DatePicker - only allow Monday to be selected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(".week").datepicker("option", { | |
| beforeShowDay: function (date) | |
| { | |
| return [date.getDay() == 1, '']; | |
| } | |
| }); | |
| // prevent changing weeks and months | |
| var weekOptions = { "changeMonth": false, "changeYear": false, "stepMonths": 0, beforeShowDay: function (date) { | |
| return [date.getDay() == 1, '']; | |
| } | |
| }; | |
| $(function () { | |
| $(".week").datepicker("option", weekOptions); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment