You can use a regex pattern to validate the format in the placeholder like in the example above. The one here is a good starting point but you may want to create your own.
Try the code below in Safari without adding a valid formatted value like a string of text.
Incorrect format shows a validation error, correct format (dd/mm/yyyy or dd-mm-yyyy) will submit the form, and it disappears.
Check if value is valid