jQuery用户界面日期选择器;残疾日“;不在IE 7和IE 8中工作
我使用以下功能禁用日期选择器日历中从2011-02-13到2011-02-18的日期:jQuery用户界面日期选择器;残疾日“;不在IE 7和IE 8中工作,jquery,jquery-ui,jquery-ui-datepicker,Jquery,Jquery Ui,Jquery Ui Datepicker,我使用以下功能禁用日期选择器日历中从2011-02-13到2011-02-18的日期: function no_disabled_days(date){ dateStr1 = '2011-02-13T00:00:00'; dateStr2= '2011-02-18T00:00:00'; disabled_start_day = new Date(dateStr1);
function no_disabled_days(date){
dateStr1 = '2011-02-13T00:00:00';
dateStr2= '2011-02-18T00:00:00';
disabled_start_day = new Date(dateStr1);
disabled_end_day = new Date(dateStr2);
if(date >= disabled_start_day && date <= disabled_end_day){
return [false];
}
return [true];
}
$("#reserve_date").datepicker({
beforeShowDay: no_disabled_Days
});
功能无禁用天数(日期){
dateStr1='2011-02-13T00:00:00';
dateStr2='2011-02-18T00:00:00';
禁用的开始日期=新日期(日期STR1);
禁用\结束\日期=新日期(dateStr2);
如果(日期>=禁用\u开始\u日期和日期IE中的问题是您的格式
试试这个
alert(new Date('2011-02-13T00:00:00').getDate()); // alerts NaN, your current format
alert(new Date('2011/02/13T00:00:00').getDate()); // alerts 13
alert(new Date('02-13-2011T00:00:00').getDate()); // alerts 13
在IE 7上测试如果不需要00:00:00
,请尝试删除它。您好,这是需要的,最初我没有使用T00:00:00,然后我发现它会导致Firefox中的本地时区问题,只有T00:00:00,这个问题才能避免。是的,但如果我将其更改为2011/02/13T00:00:00,Firefox无法正常工作。似乎没有唯一的解决方法解决方案,使其在Chrome、Firefox和IE7,8中同时工作。。。