2.0.1 • Published 7 months ago
alvins-time-picker v2.0.1
Alvin's Time Picker
A lightweight, customizable datetime picker component with no dependencies.
Features
- Pure JavaScript with no dependencies
- Customizable min/max dates
- 12-hour time format with AM/PM
- Month/Year selection
- Mobile-friendly design
- Customizable styling
- Event callbacks
- Range picker support
Installation
bash npm install alvins-time-picker
Usage
javascript import DateTimePicker from 'alvins-time-picker'; const picker = new DateTimePicker({ minDate: new Date(), onConfirm: (date) => console.log(date) }); picker.attach(document.querySelector('#datetime-input'));
Options
Option | Type | Default | Description |
---|---|---|---|
minDate | Date | new Date() | Minimum selectable date |
maxDate | Date | null | Maximum selectable date |
onConfirm | Function | null | Callback when date is confirmed |
isRangePicker | Boolean | false | Enable range picker mode |
rangeStart | Date | null | Start date for range |
rangeEnd | Date | null | End date for range |
linkedPicker | DateTimePicker | null | Linked picker for range selection |
License
MIT