Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
433 views
in Technique[技术] by (71.8m points)

javascript - 对于js calender,我想禁用上个月的日期,例如(从2019年10月31日开始)和所有从明天开始的日期。 即(2019年11月29日)(For js calender , i want to disable lastmonth date i.e (From 31-Oct 2019) and all the dates from tomorrow . i.e (29-Nov 2019))


My Calender code is
Calendar.setup ({
    inputField : "date11", ifFormat : "%Y-%m-%d", showsTime : false, button : "date11_img"+t_i, singleClick : true, step : 1, dateStatusFunc : dateRange
    });
Function 
function dateRange(date)
{
    var todaydate="";
    var d = new Date(),
    month = '' + (d.getMonth() + 1),
    day = '' + d.getDate(),
    year = d.getFullYear();
    if (month.length < 2) month = '0' + month;
    if (day.length < 2) day = '0' + day;
    todaydate= [year, month, day].join('-');
    var splittoday = todaydate.split("-");
    var m = Number(splittoday[1])-1;
    var now = new Date(Number(splittoday[0]),Number(m),Number(splittoday[2]),0,0,0);
    now.setDate(now.getDate());
    return (date.getTime() > now.getTime());
}   
I want to how to disable 2 different sets of dates . Currently i have disabled all the future dates . 
Now i want to disable all past month dates for the same calender. 

2 different set of values should be passed to that this scenario handles .

(应将2个不同的值集传递给此方案处理的值。)

I have called 1 function but i want to call 1 more function .Need the method to do that case.

(我已经调用了1个函数,但我想再调用1个函数。需要这种方法。)


  ask by chetana lotliker translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...