I have an Angular project, where one of the components have an input time like:
<div class="start">
<p>Inicio:</p>
<input type="time" class="form-control"/>
</div>
It is possible to set a range in the minutes of the input? I mean, when I have to choose an hour in this input, I need to choose an hour and a minute. I want the possibility of visualize only the minute 00 and the minute 30, instead of all the minutes 00, 01, 02, 03...59
What you're describing isn't really a "range" - what you want is to set the resolution of the input to 30 minutes, instead of 1 minute.
And you can do that with the
step=""attribute. Fortype="time"thestep=""attribute's unit is seconds, so 30 minutes is 1,800 seconds:...however, none of the major browsers seem to support the
step=""attribute withtype="time"yet (using Chrome 117, it encounters a step mismatch, which means Chrome internally supports thestepattribute, but doesn't constrain the time-picker UI tostep).Reasonable alternatives:
Something like this, I guess: