You do not need a date validator. It does not support the dd / mm / yyyy format , and therefore you get the message "Please enter a valid date" for input, for example, 01/13/2014. You already have a dateITA validator that uses the dd / mm / yyyy format as needed.
Like the date validator, your code for dateGreaterThan and dateLessThan calls new Date for the input line and has the same parsing results. You can use this function to parse the date:
function parseDMY(value) { var date = value.split("/"); var d = parseInt(date[0], 10), m = parseInt(date[1], 10), y = parseInt(date[2], 10); return new Date(y, m - 1, d); }
izstas Jun 24 '14 at 8:53 2014-06-24 08:53
source share