Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Input type="time" more than 24 hours

I just ran into the following problem:

In a web-app UI I want the user to input a timeframe in hours in which to respond to a message. The timeframe should be up to 72 hours. We’d love to use <input type="time"> but its limited to 24 hours max.

<input type="time"> has an optional max value. I think a default maximum of 24 hours makes sense but it would be handy if the max could get set all the way up to 99:99 hours.

Any suggestions on where I can suggest a change in the standard?

like image 800
mrflix Avatar asked Jun 17 '15 12:06

mrflix


People also ask

How do I change input type time in 24-hour format?

input type="time" The value of the time input type is commonly in 24-hour format ("hh:mm").

How do you restrict time in HTML?

Definition and UsageThe max attribute specifies the maximum value (time) for a time field. Tip: Use the max attribute together with the min attribute to create a range of legal values. Tip: To set or return the value of the min attribute, use the min property.

How do I add AM PM to input type time?

If you want the time with AM & PM, check the first two values, and utilize something like the following: if(FirstTwoNums > 12){ FirstTwoNums -= 12; PM = true;}/*else, PM is false */ .


1 Answers

You can try to use the number type as:

<input type="number" min="0" max="100">
like image 169
Rahul Tripathi Avatar answered Sep 18 '22 04:09

Rahul Tripathi