Bharat Bharat - 3 years ago 170
jQuery Question

Remove Month Selection option from Jquery UI Datepicker

I am using jquery UI datepicker to achieve custom range of Dates.


I want to remove drop down of the month and want to add Static month name In from datepicker.


enter image description here

I can achieve it with sort of hacks, but Is there any other way that I can remove it directly from declaration.

Here is my code (Not full code but only initialization of From datepicker).

var dateFormat = "mm/dd/yy",
from = $("#from")
.datepicker({
defaultDate: "+1W",
changeMonth: true,
numberOfMonths: 2,
minDate: +7
});

Answer Source

Change changeMonth to false.

var dateFormat = "mm/dd/yy",
      from = $("#from")
        .datepicker({
            defaultDate: "+1W",
            changeMonth: false,
            numberOfMonths: 2,
            minDate: +7
      });
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download