Jquery datepicker - only day and month

tanon picture tanon · Jul 23, 2011 · Viewed 42.1k times · Source

I want the user to specify their birthday or anniversary date (without year) in a form. For this, I want to use jquery datepicker but it should not show any year option at all. How to do it?

I tried modifying the code in this so question by making changeDay: true and changeYear: false but could not get it to work.

Answer

Nicola Peluchetti picture Nicola Peluchetti · Jul 23, 2011

You could do:

$('#date').datepicker( {
        changeMonth: true,
        changeYear: true,
        showButtonPanel: true,
        dateFormat: 'dd MM'
    });

fiddle http://jsfiddle.net/u8GnD/1/