Confirm Date must be greater than Join Date using customeValidator
function validate_date(source, args) {
var joinDate = document.getElementById('<%=txt_dateofjoin.ClientID %>').value;
var confDate = document.getElementById('<%=txt_confirmationdate.ClientID %>').value;
var dt = new Date(joinDate);
var dt2 = new Date(confDate);
var myDate = dt.format("mm-dd-yyyy");
var myDate2 = dt2.format("mm-dd-yyyy");
if (myDate < myDate2)
args.IsValid = true;
else
args.IsValid = false;
}
this code is not working. There are problem with "dt.format() function" I know it but how can I validate two dates now.