I have managed to get the jquery datepicker almost how I need it, I am not a javascript expert at all. So really need someone who is to help me extend this.
At the moment I can disable a day of the week and also specify holiday dates to disable as well.
What I need to do is to enable certain dates on the sunday through the year, for example next year mothers day 3rd April 2011 I need that to be selectable, and also some other dates. Please help as I am behind schedule.
Here is the code working up to now
[code]
<script type=”text/javascript”>
$(document).ready(function(){
* * $(“#datepicker”).datepicker({
* * * * beforeShowDay: nonWorkingDates,
* * * * numberOfMonths: 1,
* * * * minDate: ‘0’,
* * * * maxDate: ‘+12M’,
* * * * firstDay: 1
* * });
* * function nonWorkingDates(date){
* * * * var day = date.getDay(), Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6;
* * * * var closedDates = [[7, 29, 2009], [8, 25, 2010]];
* * * * var closedDays = [[Sunday]];
* * * * for (var i = 0; i < closedDays.length; i++) {
* * * * * * if (day == closedDays[i][0]) {
* * * * * * * * return [false];
* * * * * * }
* * * * }
* * * * for (i = 0; i < closedDates.length; i++) {
* * * * * * if (date.getMonth() == closedDates[i][0] – 1 &&
* * * * * * date.getDate() == closedDates[i][1] &&
* * * * * * date.getFullYear() == closedDates[i][2]) {
* * * * * * * * return [false];
* * * * * * }
* * * * }
* * * * return [true];
* * }
});
</script>