I need to create a jquery ui datepiker that only shows year and month:
$(document).ready(function () {
var montPiker = $(".monthPicker").datepicker({
changeMonth: true,
changeYear: true,
});
$(".monthPicker .ui-datepicker-calendar").hide();
});
<div id="monthPicker" class="monthPicker"></div>
the idea is to have a month/year inline picker, but the problem I'm having is that after I change the month or year the callendar part is shown again. I have try to reapply the .hide()
but I can't find on which event should it happend.
Anyone know, how to solve this? thanks.
The actual problem is after initializing the
datepicker
, you're hiding the calender. Hence the calender is showing up, whenever you change the year/month.The best way is to do with
CSS
, an explicit approach.JSFiddle
Hope this helps.