Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML input time, step attribute to set timestep by (say) x minutes?

Tags:

html

input

I have a time input, basically just:

Time: <input type="time" name="timeinput"/> 

http://jsfiddle.net/X8E9N/

According to http://www.w3.org/TR/html-markup/input.time.html it supports the step attribute. Is it possible to use this attribute (or other means) to set the step size to 10 minutes? If so, how?

I am aware of some other solutions (e.g. datebox plugin), but I'm hoping for a purely html solution if possible. I am using the datebox plugin sometimes, but it seems pretty slow on mobile devices so I am trying to use the native time pickers when possible.

like image 757
amomin Avatar asked Dec 04 '12 23:12

amomin


2 Answers

Seems like Chrome 86 does not support this.

like image 168
Anders Lindén Avatar answered Nov 16 '22 02:11

Anders Lindén


It's possible. You just need to put seconds in step parameter, ex.

<input type="time" step="300"> <!-- 5 min step -->
like image 28
kacper Avatar answered Nov 16 '22 01:11

kacper