Hello I have problem validating and confirming date format of given date.
Admin enters valid date format for input and user enters date in input.
For example: User enters 2020-05-10 and admin has entered Y-m-d my validation function must return true
Both inputs are dynamic and I don't have idea how to confirm format
I saw this solution but this is not dynamic: Check date format in JavaScript
Any help will be apreciated
[<>]snippet editor.2020-05-10's format is notY-m-d. By convention, the format isYYYY-MM-DD(Year with 4 digits, month with two digits, day with two digits). Look at Moment's format and validation