In reporting specially, datepicker with month and year only are a better way to provide information to form for submission without need of the day.
In my case, I modified one picker $( “#month” ).datepicker to fill both month and year input field
$( "#month" ).datepicker({ buttonImageOnly: true, dateFormat: "MM yy", changeMonth: true, changeYear: true, showButtonPanel: true, numberOfMonths: 1, //setDate: checkindate, onClose: function(dateText, inst) { var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val(); var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val(); $("#month").val($.datepicker.formatDate('mm', new Date("", month, 1))); $( "#year" ).val($.datepicker.formatDate('yy', new Date(year, "", 1))); }, });
Month: <input type="text" id="month" name="month"></input> <br></br> Year: <input type="text" id="year" name="year"></input>
What do you think?