0

I need to make the year optional when selecting a date in the JQuery DatePicker. Please note the word optional. I do not want to remove the year, I just want to make it optional.

Why? I am storing date of birth and sometimes people don't give the year they were born.

I don't think this is possible with the built in DatePicker. If not, does anyone know of another solution I could use?

Appreciate your help in advance!

Ben

Ben Sinclair
  • 3,896
  • 7
  • 54
  • 94
  • 2
    I missed it. I think this has to be handled in your js not in datepicker and also I dont find no use of DOB without year – Praveen Jan 27 '14 at 06:00

2 Answers2

0

JQuery does not allow this sort of an option. You can anyway take a look at this plugin which allows you to select only the month. If you want to use the year as optional, you might check this.

Community
  • 1
  • 1
MusicLovingIndianGirl
  • 5,909
  • 9
  • 34
  • 65
0

Try this, change the date format however you want. This one will enter "01-27"(mm-dd) in your textbox.

 $.datepicker.setDefaults({
        inline: true,
        changeMonth: true,
        dateFormat: "mm-dd",
    });
beck03076
  • 3,268
  • 2
  • 27
  • 37