4

Im have to do a Website-Project and i will use the input type "datetime-local" to choose a date+time. When i write some Numbers in it, the YEAR will always have 7 characters (instead of 4).

How can i change this?

Greetings

2

1 Answer 1

7

HTML specification doesn't define the upper limit of dates for <input type=datetime-local>. However, ECMA Script defines the upper limit of Date object. It's September 13 275,760.

You can set the upper limit in your HTML, and Google Chrome shrinks the year field if it's less than 6 digits.

<input type="datetime-local" max="9999-12-31T23:59">
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.