http://stackoverflow.com/questions/3509683/validate-two-dates-of-this-dd-mmm-yyyy-format-in-javascript[
^]
function customParse(str) {
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
n = months.length, re = /(\d{2})-([a-z]{3})-(\d{4})/i, matches;
while (n--) { months[months[n]] = n; }
matches = str.match(re);
return new Date(matches[3], months[matches[2]], matches[1]);
}
function dtdatecompare()
{
alert(document.getElementById('ctl00_SampleContent_Date1').value);
var dt =document.getElementById('ctl00_SampleContent_Date1').value;
var currentTime = new Date();
currentTime = currentTime.format('dd-MMM-yyyy');
alert(currentTime.toString());
alert(customParse(dt));
alert(customParse(currentTime));
if (customParse(dt) > customParse(currentTime)) {
alert('invalid');
}
else {
alert('correct');
}
}