A lightweight, customizable, TimePicker.
→ NPM
npm i timepicker.js
→ CDN Hosted - jsDelivr
Load:
<script src="https://cdn.jsdelivr.net/npm/timepicker.js/dist/timepicker.iife.min.js"></script>
const timepicker = new TimePicker('#click-trigger', {
theme: 'dark',
lang: 'pt',
})
timepicker.on('change', (evt) => {
console.log(evt)
// {
// hour: string;
// minute: string;
// element: HTMLElement;
// }
})
{String|Element}
String or DOM node.
theme
:'dark'
; Theme colorlang
:'en'
; Header language
To be used programatically. Same for hide()
.
All targets passed to the constructor will be shown.
timepicker.on('open', function (evt) {});
timepicker.on('close', function (evt) {});
timepicker.on('change', function (evt) {});
- dark
- red
- pink
- purple
- deep-purple
- indigo
- blue
- light-blue
- cyan
- teal
- green
- light-green
- lime
- yellow
- amber
- orange
- deep-orange
- brown
- blue-grey