Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.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 jquery日期选择器_Javascript_Jquery_Ruby On Rails_Jquery Ui_Datepicker - Fatal编程技术网

Javascript jquery日期选择器

Javascript jquery日期选择器,javascript,jquery,ruby-on-rails,jquery-ui,datepicker,Javascript,Jquery,Ruby On Rails,Jquery Ui,Datepicker,我正在rails项目中使用jquery日期选择器,我想禁用以前/过去的日期 有没有办法做到这一点。以及如果小于当前日期的时间禁用所有日期直到今天: // get the current date var date = new Date(); var m = date.getMonth(), d = date.getDate(), y = date.getFullYear(); // Disable all dates till today $('#datepicker2').datepicke

我正在rails项目中使用jquery日期选择器,我想禁用以前/过去的日期


有没有办法做到这一点。以及如果小于当前日期的时间

禁用所有日期直到今天:

// get the current date
var date = new Date();
var m = date.getMonth(), d = date.getDate(), y = date.getFullYear();

// Disable all dates till today
$('#datepicker2').datepicker({
        minDate: new Date(y, m, d),
        dateFormat: 'mm-dd-yy',
});

请参阅此

中的更多好选项禁用所有日期直到今天:

// get the current date
var date = new Date();
var m = date.getMonth(), d = date.getDate(), y = date.getFullYear();

// Disable all dates till today
$('#datepicker2').datepicker({
        minDate: new Date(y, m, d),
        dateFormat: 'mm-dd-yy',
});

查看此

中的更多好选项您是否尝试将minDate选项设置为当前日期


您是否尝试将minDate选项设置为当前日期


该链接对我非常有用,我肯定会使用它,但我还需要禁用当前日期的过去时间。现在我正在使用datetimepicker进行其他功能,我需要时间。该链接对我非常有用,我肯定会使用它,但我还需要禁用当前日期的过去时间。现在我正在使用datetimepicker实现其他功能,我需要时间。。