The default date format on our site is set to dd/mm/yyyy (d/m/Y).

We have a date field that has the following validation:
- Must be on or after today
- Required
- In dd/mm/yyyy format

This works very well in all browsers except IE and Edge where the submitted date value has the month and day flipped and causes PHP validation error. A screenshot has been attached.

The export of the test form is here:

date:
  '#type': date
  '#title': Date
  '#default_value': today
  '#required': true
  '#min': today
  '#date_date_format': d/m/Y
Files: 
CommentFileSizeAuthor
date-error.jpg58.9 KBJason Guo

Comments

Jason Guo created an issue. See original summary.

jrockowitz’s picture

Status: Active » Closed (won't fix)

This is a known issue with IE. @see http://caniuse.com/#feat=input-datetime

I recommend using the date list element.