Try this demo: http://jsfiddle.net/rAdV6/20/
Also see both screenshots below.
To elaborate further, this fix will allow to have multiple date pickers with or without year on top appear on the top of the calendar.
jQuery code:
$('.DateTextBox.NoYear').datepicker({
beforeShow: function (input, inst) {
inst.dpDiv.addClass('NoYearDatePicker');
},
onClose: function(dateText, inst){
inst.dpDiv.removeClass('NoYearDatePicker');
}
});
$('#datepicker').datepicker( { changeYear: false, dateFormat: 'dd/mm',});
$('#datepicker1').datepicker( { changeYear: true, dateFormat: 'dd/mm', });
$('#datepicker2').datepicker( { changeYear: false, dateFormat: 'dd/mm', });
CSS:
.NoYearDatePicker .ui-datepicker-year
{
display:none;
}
HTML:
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all">
date (without year) <input type="text" id="datepicker" class="DateTextBox NoYear">
<br />
date 1: (With year) <input type="text" id="datepicker1" >
<br />
date 2: (Without year) <input type="text" id="datepicker2" class="DateTextBox NoYear">
?
How it appears in my lappy OSX:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…