HTML 5 generates type input time with min and max

I managed to use the input date of the type with the min and max attributes in the form that I am developing using as much as possible HTML 5. However, I cannot do the same if the input type is time .

Relevant Code:

<input style='width:120px' required name='dia' id='dia' type='date' min="1991-01-01" max="2014-05-12"> <input style='width:80px' required name='hora' id='hora' type="time" min="08:00:00" max="20:00:00"/> 

(min and max in the last are ignored)

Other relevant information:

  • As far as I can tell, the HTML 5 spec allows you to use min and max in both cases.

  • I use minimizr and webshims for this form, which allows you to enter date input fields in FF, etc.

  • No other behavior was found between recent major browsers.

  • On a site like W3C schools, min and max are indicated for the date, but not for time, which may indicate a general lack of enthusiasm for min and max as attributes of the time.

Am I missing something obvious?

+4
source share
1 answer

It works. It works according to the type of lowering when the time is greater than or equal to 08:00. (Tested in chrome)
Some other browser ignores the min, max attribute, so you need to pay attention to this with JS.

+3
source

Source: https://habr.com/ru/post/1480323/


All Articles