2015-11-06 36 views
0

我試過每一個選項。 MaxDate,MinDate,Beforeshowday。但它仍然不起作用。但是我的Datepicker正在顯示並運行良好。但我不能在日期選擇器中配置任何選項。任何幫助將不勝感激日期選擇器選項不起作用

這裏是低於

<script type="text/javascript"> 
jQuery(document).ready(function(){ 

$('#datepicker').datepicker({ 
    beforeShowDay: $.datepicker.noWeekends, 
    minDate: '0', 
}); 
}); 

</script> 

回答

1

請從https://jqueryui.com/datepicker/#default

<!doctype html> 
    <html lang="en"> 
    <head> 
     <meta charset="utf-8"> 
     <title>jQuery UI Datepicker - Dates in other months</title> 
     <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> 
     <script src="//code.jquery.com/jquery-1.10.2.js"></script> 
     <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> 
     <link rel="stylesheet" href="/resources/demos/style.css"> 
     <script> 
     $(function() { 
     $("#datepicker").datepicker({ 
      showOtherMonths: true, 
      selectOtherMonths: true 
     }); 
     }); 
     </script> 
    </head> 
    <body> 

    <p>Date: <input type="text" id="datepicker"></p> 


    </body> 
    </html> 

而對於beforeShowDay檢出代碼示例代碼,請檢查JQuery DatePicker and beforeShowDay

+0

這有助於謝謝!我的錯誤是我複製了.datepicker函數,並搞砸了jQuery程序。 – Jon

+0

@JonBonJoviMateo很高興能幫到你。 – prashant