javascript validate date yyyy mm dd format





It was for the format MM/DD/YYYY but i tried changing the regex so there was 4 for the first part (which was 2) and the last one to 2 which was 4. Sorry, I dont really know what Im doing with regex within JavaScript.How to validate an email address in JavaScript? jquery - Format date to MM/dd/yyyy in javascript - Stack Overflow.I need sample javascript code to validate the date with mm-dd-yyyy format. 1) if user enters wrong date with respect to above date format. Note supplied date format and date string go hand in hand.