bobighorus bobighorus - 3 months ago 19
jQuery Question

jquery ui datepicker day/month only, not year selection

I've searched here in SO and all around but no properly solutions founded for this issue.
With jQueryUI DatePicker I need to select a recursive date for all years, so I don't wanna show year selection, 'cause it doesn't make sense.

How can I obtain this inside the call like the following?

$('#myInput').datepicker({ dateFormat: "dd/mm" });

Note: I can't use css solution as suggested here
because there are other datepickers in the same page.

Any help will be appreciated.

Thanks in advance.


HIya try this please demo : this is what you want bruv

which ever suits you man :) also see both screen shot below and please don't forget to accept and up vote if this helps :))

Edit 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.

Hope this helps! cheers

jquery code

            beforeShow: function (input, inst) {
            onClose: function(dateText, inst){

$('#datepicker').datepicker( { changeYear: false, dateFormat: 'dd/mm',});

$('#datepicker1').datepicker( { changeYear: true, dateFormat: 'dd/mm', });

$('#datepicker2').datepicker( { changeYear: false, dateFormat: 'dd/mm', });


 .NoYearDatePicker .ui-datepicker-year


    <link rel="stylesheet" href="" 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">

Image below to show How it appears in my lappy OSX as well :)

enter image description here