I need end date to be after or equal to the start date. This is the code that I found.
jQuery.validator.addMethod("greaterThan",
function (value, element, params) {
if (!/Invalid|NaN/.test(new Date(value))) {
return new Date(value) > new Date($(params).val());
}
return isNaN(value) && isNaN($(params).val())
|| (Number(value) > Number($(params).val()));
}, 'Must be greater than {0}.');
I believe this works in a different format than what I want which is "DD/MM/YYYY". Is there anyway to format this?