In general, good date validation is very difficult. From Time and the Art of Living (as quoted in the GNU date documentation), I quote Robert Grudin:
Our units of temporal measurement,
from seconds on up to months, are so
complicated, asymmetrical and
disjunctive so as to make coherent
mental reckoning in time all but
impossible. Indeed, had some
tyrannical god contrived to enslave
our minds to time, to make it all but
impossible for us to escape subjection
to sodden routines and unpleasant
surprises, he could hardly have done
better than handing down our present
system.
However, if you only want to accept dates in that YYYY-MM-DD format, the work gets a little easier. How about something like:
dateISO: function(value, element) {
if (this.optional(element)) return true;
var regexp = new RegExp('^\d{4}[\/-](\d{1,2})[\/-](\d{1,2})$');
var matches = regexp.exec(value);
if (!matches) return false;
if (matches[2] > 31) return false;
if (matches[1] == 2 && matches[2] > 28) return false;
if ((matches[1] == 1 || matches[1] == 3 || matches[1] == 5 || matches[1] == 7 || matches[1] == 8 || matches[1] == 10 || matches[1] == 12) && matches[2] > 30) return false;
return true;
},