<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>cal</title> <link href="ui-lightness/jquery-ui-1.10.4.custom.css" rel="stylesheet" /><!--jquery ui css--> <script src="jquery-v1.11.0-min.js"></script><!--jquery js--> <script src="jquery-ui-v1.10.4-min.js"></script><!--jquery ui js--> </head> <body> <input id="Datepicker" type="text" onclick="javascript: PickDate();" /> <script type="text/javascript"> function PickDate() { var d = new Date(); var natt = { "holidays": ['05/23/2014', '05/27/2014', '05/29/2014', '5/30/2014'] }; var natDays = natt.holidays; function nationalDays(date) { var m = date.getMonth(); var d = date.getDate(); var y = date.getFullYear(); for (i = 0; i < natDays.length; i++) { if ((m == natDays[i][0] - 1) && (d == natDays[i][1]) && (y == natDays[i][2])) { return [false]; } } return [true]; } function noWeekendsOrHolidays(date) { var noWeekend = $.datepicker.noWeekends(date); if (noWeekend[0]) { return nationalDays(date); } else { return noWeekend; } } $("#Datepicker").datepicker({ minDate: new Date('20 May 2014'), maxDate: "+60D", hideIfNoPrevNext: true, beforeShowDay: noWeekendsOrHolidays, }); $("#Datepicker").datepicker('show'); } </script> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)