time-inputter
v2.0.2
Published
add `hh:mm`format to input element.
Downloads
4
Readme
time-input with vanilla js
What is this ?
add hh:mm
format to input element.
how to use
- install
npm install time-inputter
import and execute on your app
import { timeInputter } from 'time-inputter';
timeInputter();
or download dist/time-inputter.min.js
file and add script directly
<script type="module">
import { timeInputter } from '.time-inputter.min.js';
timeInputter();
</script>
</body>
- add
time-inputter
to className
<input class="time-inputter" value="09:00" />
Dedicated attributes
value
set a default value.
p.s. need to hh:mm format (/[0-9]{2}:[0-5][0-9]/)
<input class="time-inputter" value="09:00" />
maxHour
set a maximum value for time input.
p.s. need to 2-digit numeric string (/[0-9]{2}/)
<input class="time-inputter" maxHour="23" />