Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.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
禁用过去几个月&;使用Jquery的年份_Jquery_Twitter Bootstrap - Fatal编程技术网

禁用过去几个月&;使用Jquery的年份

禁用过去几个月&;使用Jquery的年份,jquery,twitter-bootstrap,Jquery,Twitter Bootstrap,使用以下代码禁用过去日期,但不起作用 $("#card_expiry").datepicker({ format: "mm-yyyy", startView: "months", minViewMode: "months", changeMonth: false, changeYear: false, stepMonths: 0

使用以下代码禁用过去日期,但不起作用

    $("#card_expiry").datepicker({
            format: "mm-yyyy",
            startView: "months",
            minViewMode: "months",
            changeMonth: false,
            changeYear: false,
            stepMonths: 0
        });
心仪的

类型:日期、数字或字符串

默认值:null

可选择的最小日期。设置为null时,没有最小值。 支持多种类型:

日期:包含最小日期的日期对象

编号:从今天起的天数。例如,2代表从今天开始的两天,-1代表昨天


字符串:采用dateFormat选项定义的格式的字符串,或相对日期。相对日期必须包含值和期间对;有效期为“y”表示年,“m”表示月,“w”表示周,“d”表示天。例如,“+1m+7d”表示从今天开始的一个月零七天。

您是否尝试过
minDate:0
startDate:new Date()
?工作:startDate:new Date()工作:startDate:new Date()
   Following code works for me:

  $("#card_expiry").datepicker({
            format: "mm-yyyy",
            startView: "months",
            minViewMode: "months",
            changeMonth: false,
            changeYear: false,
            stepMonths: 0,
            startDate: new Date()
        });
minDate:0
   Following code works for me:

  $("#card_expiry").datepicker({
            format: "mm-yyyy",
            startView: "months",
            minViewMode: "months",
            changeMonth: false,
            changeYear: false,
            stepMonths: 0,
            startDate: new Date()
        });