从数组中的UI日期选择器中禁用日期

时间:2014-05-15 14:34:30

标签: sql-server arrays jquery-ui date datepicker

之前我曾问过类似的问题,但我遇到了问题,并且想知道你是否可以提供帮助,我正在编写一个函数来禁用我的UI-Datepicker中的日期,这些日期都在一个数组中。日期是从SQL Server表填充,然后放在一个数组中,现在我想要禁用这些日期。我对编程还是比较新的,我希望以前没有问过这个问题。

我目前的代码:

var connection = new ActiveXObject("ADODB.Connection") ;

var connectionstring="Data Source=;Initial Catalog=;User ID=;Password=;Provider=SQLOLEDB";

connection.Open(connectionstring);
var rs = new ActiveXObject("ADODB.Recordset");
var count === 0;
var BankHolidays;

rs.Open("SELECT * FROM CompanyBankHolidays", connection);
rs.MoveFirst;
while(!rs.eof) {
    count = count + 1;
    BankHolidays[count] = (rs.fields(1));
    rs.movenext;
}

rs.close;
connection.close;

function IsBankHoliday(date) {
    ///HELP HERE PLEASE//
}

$(function () {
    $(".startdate").datepicker({
    minDate: ('+1d'),
    changeMonth: true,
    dateFormat: 'dd/mm/yy',
    beforeShowDay: function (date) {
        return [(!IsChristmas(date) && !IsNewYearsDay(date) && !IsWeekend(date))];
        },
        onClose: function (selectedDate) {
            $(".enddate").datepicker("option", "minDate", selectedDate);
        }
    });
});

$(function () {
    $(".enddate").datepicker({
    minDate: ('+1d'),
    dateFormat: 'dd/mm/yy',
    beforeShowDay: function (date) {
        return [(!IsChristmas(date) && !IsNewYearsDay(date) && !IsWeekend(date))];
        },
        onClose: function (selectedDate) {
            $(".startdate").datepicker("option", "maxDate", selectedDate);
        }
    });
});

0 个答案:

没有答案