I need to validate a date for if it is a future valid date. While inputting date in the form I'm using the date format dd/mm/yyyy
using Jquery validation plugin with dateITA rule. I've added the following validation method
$.validator.methods.futuredocexp = function( value, element ) {
var now = new Date();
var myDate = new Date(value);
return this.optional(element) || myDate > now;
};
It only works if dates are in the american format like dd-mm-yyyy How can I make it work for dd/mm/yyyy?