jQuery ui Datepicker如果第二天hasClass

时间:2016-04-13 13:36:33

标签: jquery jquery-ui datepicker

是否有一种简单的方法可以检测datepicker小部件中的第二天是否已禁用该类'?

我使用beforeShowDay:checkAvailability,日历,但延长了半预订日期。现在我想检查第二天是否已禁用,以便用户无法预订。

亲切的问候,

斯蒂芬

switch ($durationValue) { 
    case 'weekend': 
        for (var i = 0; i < $myBadDates.length; i++) {
            if ($myBadDates[i] == $checkdate) {
                if ($.inArray($myBadDates[i], $halfavailable) !== -1) {

                    $returnclass = "halfavailable";
                } else {

                    $returnclass = "unavailable";
                }
            }
        }
        return [mydate.getDay() == 5, $returnclass];
        break;
    case 'midweek': 
        for (var i = 0; i < $myBadDates.length; i++) {
            if ($myBadDates[i] == $checkdate) {
                if ($.inArray($myBadDates[i], $halfavailable) !== -1) {
                    $returnclass = "halfavailable";
                } else {
                    $returnclass = "unavailable";
                }
            }
        }
        return [mydate.getDay() == 1, $returnclass];
        break;
    case 'week': 
        for (var i = 0; i < $myBadDates.length; i++) {
            if ($myBadDates[i] == $checkdate) {
                if ($.inArray($myBadDates[i], $halfavailable) !== -1) {
                    $returnclass = "halfavailable";
                } else {
                    $returnclass = "unavailable";
                }
            }
        }
        return [mydate.getDay() == 1, $returnclass];
        break;
    default: ''
}

0 个答案:

没有答案