繁体   English   中英

如何禁用日历中的月份

[英]How to disable click on month in calendar

如您在图像上看到的,我要禁用单击2017年12月(黑框)。 我怎样才能做到这一点?

在此处输入图片说明

我的日历JavaScript函数。

$('#datepicker').datepicker({
    changeYear: true,
    multidate: true,
    maxViewMode: 0,
    startDate: today,
})

也许您可以使用changeMonth选项,如下所示:

 $('#datepicker').datepicker({ changeYear: true, changeMonth: false, multidate: true, maxViewMode: 0, startDate: new Date(), }); $('#datepicker2').datepicker({ changeYear: true, changeMonth: true, multidate: true, maxViewMode: 0, startDate: new Date(), }); 
 input { width: 25%; margin: 1%; } 
 <link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script> <input type="text" id="datepicker" placeholder="You can't change my month !" /> <input type="text" id="datepicker2" placeholder="You can change my month !" /> 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM