I want to show only month and year. If I refocused same input after select a date, it shows wrong month and year not show previously selected month and year. For example I select December 2010 and then refocused same input it shows April 2015 as below image. How can I?
HTML
<input type="text" class="dp" readonly="true">
CSS
.ui-datepicker-calendar {
display: none;
}
JS
$('.dp').datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true,
dateFormat: 'mm.yy',
onClose: function (dateText, inst) {
$(this).datepicker('setDate', new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay));
}
});