简体   繁体   中英

How to disable click on month in calendar

As you can see on the image I want to disable click on December 2017 (black box). How can I do this?

在此处输入图片说明

My javascript function for the calendar.

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

Maybe you could use changeMonth option as following :

 $('#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 !" /> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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