title: jQueryUI DatePicker Customizing the Year
body: <p>I have a Datepicker using jqueryui DatePicker.</p>
  
  <p>The behavior requirement is:</p>
  
  <ul>
  <li><p>A User can store a Birthdate for a friend.  The User should be able to store a year if known, or select "N/A". </p></li>
  <li><p>If "N/A" is selected, Store the year 1900 in the database and only display the day and month in an input field to the User.</p></li>
  <li><p>The dropdown should start at 1950 but show the past 100 years from current date (&lt;-- this would be icing on the cake, otherwise start at current year and if necessary go back to 1900)</p></li>
  </ul>
  
  <p>Here's what I got so far, but it's kludgey...and that's an understatement.  And for some reason, if the user selects a date, but doesn't alter the year dropdown, then the current year is stored, rather than 1900.</p>
  
  <p>(it's in the context of a json call).  Surely there's a better way.    </p>
  
  <pre><code>var birthday_options = {changeMonth: true, changeYear: true, yearRange: '1900:2010',
          onClose: function(dateText, inst) {
          contact.field_updater('birthday').call(this);
          $('input.mng-birthday').val(function(i, val) {
                         return val.replace('/1900', '');
                      });
          },
          beforeShow: function (input) {
                        setTimeout(function () {
                          $('select.ui-datepicker-year option:first').text('N/A');                                                                 
                        }, 1);
                      }},
  
  .find('.mng-birthday').val(data.birthday || 'Unknown')
    .datepicker(birthday_options)
  .end(); 
  </code></pre>