John Smith
John Smith

Reputation: 11

Is the max attribute, while being used with the date input type restricted only to the yyyy/mm/dd format?

I've tried turning

<input type="date" max="1967-12-25">

into

<input type="date" max="12-25-1967">

while the former worked, the latter didn't

Upvotes: 0

Views: 18

Answers (1)

deceze
deceze

Reputation: 522005

The specification requires the format to be YYYY-MM-DD. Otherwise it would be the same problem that all date-as-string representations have: what is the format? **-**-YYYY equally permits the interpretation as DD-MM-YYYY and MM-DD-YYYY, and any other order has the same problem. You have to stick to some standard, and that is defined as YYYY-MM-DD, period.

Upvotes: 1

Related Questions