請大家看我的fiddle限制年月/ DatePicker的
什麼我以後是「上一個」按鈕,如果一年本年度比賽被禁用,但我也想限制「下一步」按鈕只能在下一年啓用,如果他們點擊它,則會被禁用。
我試過使用minDate: "0"
和maxDate: "1y"
但他們不工作。
HTML
<div class="input-group date" style="width: 200px">
<input type="text" id="example1" class="form-control" style="cursor: pointer"/>
<span class="input-group-addon">
<i class="glyphicon glyphicon-calendar"></i>
</span>
</div>
JQuery的
$('#example1').datepicker
({
format: "MM yyyy",
minViewMode: 1,
changeYear: true,
autoclose: true
});
CSS
.datepicker-switch
{
pointer-events: none;
}
我不希望有加年到我的代碼,否則我將不得不每年更新它併發布我的網站,所以如何在不添加此功能的情況下完成此操作。
以爲我已經刪除了'changeYear'哈哈,但是您的解決方案非常感謝。 – murday1983