Minal1 / Min
"americandate": { // Check if date is valid by leap year "func": function (field) { var pattern = new RegExp(/^(0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])[\/\-](\d{4})$/); var match = pattern.exec(field.val()); if (match == null) return false; var year = match[3]; var month = match[1]*1; var day = match[2]*1; var date = new Date(year, month - 1, day); // because months starts from 0. return (date.getFullYear() == year && date.getMonth() == (month - 1) && date.getDate() == day); }, "alertText": "* Invalid date, must be in MM/DD/YYYY format" }, where to call the function americandate?
About this discovery
This repository is cataloged as part of our automated global GitHub synchronization. Full telemetry, velocity snapshots, and code summaries are scheduled for continuous enrichment.