Is there an isDate function in jQuery?
isDate
It should return true if the input is a date, and false otherwise.
true
false
You should use moment.js it's the best lib to handle all kind of dates. Solution to your problem:
var inputVal = '2012-05-25'; moment(inputVal , 'YYYY-MM-DD', true).isValid();