I'm trying to use datetime-local to pick both date and time.
The input works okay, unfortunately I can't seem to get the step attribute to work at all.
The MDN docs seem to suggest I should be able to use it to set a step in seconds, however this just isn't working at all.
<form method='post' action='#'>
<input
type="datetime-local"
id="meeting-time"
name="meeting-time"
value="2018-06-12T19:30"
min="2018-06-07T00:00"
max="2018-06-14T00:00"
step="900"
/>
<input type='submit' value='Go!'>
</form>
Am I missing something?
So, my confusion came from the fact that step doesn't change the steps that appear in the calendar nor stops users from typing the time in themselves.
The step attribute does "work" in loosest sense possible in that it allows users to step between values with arrows after selecting them with the keyboard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With