1var stringval = '01/03/2012';
2var testdate;
3
4try {
5 testdate = $.datepicker.parseDate('mm/dd/yy', stringval);
6 // Notice 'yy' indicates a 4-digit year value
7} catch (e)
8{
9 alert(stringval + ' is not valid. Format must be MM/DD/YYYY ' +
10 'and the date value must be valid for the calendar.';
11}