$(document).ready(function () { 

  $('#monthyear').val('');
  $('#monthyearalt').val('');

  $('#monthyear').datepicker({
    dateFormat: 'MM yy',
    changeMonth: true,
    changeYear: true,
    showButtonPanel: true,
    altField: "#monthyearalt",
    altFormat: "yyMM",
    defaultDate: new Date(),
    onClose: function (dateText, instance) {
      var month = $('#ui-datepicker-div .ui-datepicker-month :selected').val();
      var year = $('#ui-datepicker-div .ui-datepicker-year :selected').val();
      $(this).val($.datepicker.formatDate('MM yy', new Date(year, month)));
      $('#monthyearalt').val($.datepicker.formatDate('yymm', new Date(year, month)));
    }
  });

});



{'avg_line_length': 27.48, 'max_line_length': 85, 'alphanum_fraction': 0.6011644832605532, 'licenses': ['MIT'], 'repository_name': 'robbinsjk/month-year-picker', 'path': 'includes/scripts/monthyear.js', 'size': 687, 'lang': 'JavaScript'}