Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在javascript日历中禁用未来3天_Javascript_Jquery_Calendar - Fatal编程技术网

在javascript日历中禁用未来3天

在javascript日历中禁用未来3天,javascript,jquery,calendar,Javascript,Jquery,Calendar,我想在javascript日历中禁用接下来的3天(不包括周日)。 星期天也应该被禁用 Calendar.setup({ inputField : '_dob', ifFormat : '%m/%e/%y', button : '_dob_trig', align : 'Bl', singleClick : true, disableFunc: function(date) {

我想在javascript日历中禁用接下来的3天(不包括周日)。 星期天也应该被禁用

 Calendar.setup({
        inputField : '_dob',
        ifFormat : '%m/%e/%y',
        button : '_dob_trig',
        align : 'Bl',
        singleClick : true,
       disableFunc: function(date)
    {
        var mydate= new Date();
        mydate.setDate(mydate.getDate()+1);
        // alert(date+'---'+mydate);
        if(date==mydate)
        {
            return true;
        } 
    }
    });
我试图提醒
date
mydate
2014年10月21日星期二14:40:11 GMT+0530(IST)---2014年10月21日星期二14:40:20 GMT+0530(IST)

请建议解决方案

找到的解决方案-

    disableFunc: function(date)
    {
        var first_day = new Date();
        var second_day= new Date();
        var third_day= new Date();

        first_day.setDate(first_day.getDate());
        if(first_day.getDay()===0)
        {
             first_day.setDate(first_day.getDate()+1);
        }

        second_day.setDate(first_day.getDate()+1);
        if(second_day.getDay()===0)
        {
            second_day.setDate(first_day.getDate()+2);
        }

        third_day.setDate(second_day.getDate()+1);
        if(third_day.getDay()===0)
        {
            third_day.setDate(second_day.getDate()+2);
        }


        var flag1 = first_day.getDate()===date.getDate() && first_day.getMonth()===date.getMonth() && first_day.getYear()===date.getYear();
        var flag2 = second_day.getDate()===date.getDate() && second_day.getMonth()===date.getMonth() && second_day.getYear()===date.getYear();
        var flag3 = third_day.getDate()===date.getDate() && third_day.getMonth()===date.getMonth() && third_day.getYear()===date.getYear();

        if(date.getDay() === 0 || flag1 || flag2 || flag3)
        {  return true; }
        else
        {  return false; }
    }
});