I\'m trying to test to make sure a date is valid in the sense that if someone enters 2/30/2011 then it should be wrong.
2/30/2011
How can I do this with any date?
function isValidDate(year, month, day) { var d = new Date(year, month - 1, day, 0, 0, 0, 0); return (!isNaN(d) && (d.getDate() == day && d.getMonth() + 1 == month && d.getYear() == year)); }