I am using the jquery ui datepicker and have it working just fine.
What I am trying to do is block Sundays and a list of specific dates. I have accomplished each task individually but I can't figure out how to do both at the same time. (not sure how to combine the functions).
If you can offer assistance, it would be MUCH appreciated.
My code to blog specific dates
here is the code I use to just block Sundays (it's inline with the datepicker functionCode:var disabledDays = ["2-20-2012"]; /* utility functions */ function nationalDays(date) { var m = date.getMonth(), d = date.getDate(), y = date.getFullYear(); //console.log('Checking (raw): ' + m + '-' + d + '-' + y); for (i = 0; i < disabledDays.length; i++) { if($.inArray((m+1) + '-' + d + '-' + y,disabledDays) != -1 || new Date() > date) { //console.log('bad: ' + (m+1) + '-' + d + '-' + y + ' / ' + disabledDays[i]); return [false]; } } //console.log('good: ' + (m+1) + '-' + d + '-' + y); return [true]; } function noHolidays(date) { return nationalDays(date); } $(function() { $( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd', minDate: +1, beforeShowDay: noHolidays }); });
How can I accomplish both of these actions? Thanks in advance for any helpCode:$(function() { $( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd', minDate: +1, beforeShowDay: function(date) { var day = date.getDay(); return [(day != 0), '']; } }); });


Reply With Quote


Thanks again for the help!


Bookmarks