2017-10-11 131 views
0

有這樣一條:無法更改月份日期選擇器

$(document).ready(function() { 
      $("#effectiveDate").datepicker({ 
       dateFormat:'yy-mm-dd', 
       minDate: 1, 
       maxDate: '+4Y', 
       dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 
       showOn: "both", 
       buttonImage: "<%=whatIsContextPath%>/images/calendar.gif", 
       buttonImageOnly: true, 
       selectOtherMonths: true 
      }); 
     }); 

這是結果:

enter image description here

如何確保我可以選擇再過一個月,喜歡這裏:

enter image description here

+2

默認情況下,您獲得該控件:https://jsfiddle.net/8b31qnpd/。如果它沒有出現給你,那麼你可能有一些CSS干擾jQueryUI –

+0

@RoryMcCrossan,你有正確的方向,我發現我沒有爲jquery-ui導入css。 – Foxy

回答

0

我的不好,只是忘了包括添加lin k到jquery-ui在我的頁面中:

<link type="text/css" href="<%=whatIsContextPath%>/stylesheet/jquery-ui-1.8.16.custom.css" rel="stylesheet" /> 
相關問題