WDatePicker使用 出现ReferenceError: disabledDates is not defined

"ReferenceError: disabledDates is not defined
at eval (eval at <anonymous>
at HTMLInputElement.<anonymous>
at HTMLInputElement.dispatch (http://code.jquery.com/jquery-3.2.1.js:5206:27)
at HTMLInputElement.elemData.handle (http://code.jquery.com/jquery-3.2.1.js:5014:28)"

调试发现以上问题,解决方案:

<html>  
    <head>  
        <title>  
            测试jquery控制My97DatetimePicker格式  
        </title>  
       
    <script src="WdatePicker.js"></script>
   <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.2.min.js"></script>
  
   
    </head>  
    <body>  
    <script type="text/javascript" >

        $(function () {

            var disableddatesArcher = ["2019-05-01", "2019-05-20", "2019-05-22", "2019-05-24", "2019-05-25"];

            var validate_date_Array = new Array();
            //查询所有有效的日期  
            validate_date_Array[0] = "2019-05-20";
            validate_date_Array[1] = "2019-05-22";
            validate_date_Array[2] = "2019-05-23";
            validate_date_Array[3] = "2019-05-24";

            $('#Text1').bind('focus', function () {
                WdatePicker({
                 opposite:true,//如果不设置则disabledDates参数中的值会是“无效日期”  
                 disabledDates: validate_date_Array //绑定数组 
                }

                 )
            }); 

        })//$(function ()结束

 
    </script>  
     
    Text1<input id="Text1" type="text" class="Wdate" />
     
    </body>  
</html>  

  

原文地址:https://www.cnblogs.com/panjinzhao/p/10837409.html