Commits

Matthew Schinckel committed f217bb1

Don't allow typing in a year outside of the available range.

Comments (0)

Files changed (1)

jquery/static/jquery.jqui/js/datepicker.js

   };
   
   dp.parseDate = function parseDate(dateString) {
-    return new Date(Date.strptime(dateString, options.displayFormat()));
+    var newDate = new Date(Date.strptime(dateString, options.displayFormat()));
+    var year = newDate.getFullYear()
+    while (year < options.minYear()) {
+        year += 100;
+        // Try to do some clever bits to work out what the value should be.
+    }
+    newDate.setFullYear(year);
+    return newDate;
   };
   
   dp.updateOptions = function updateOptions(newOptions) {