4.1.0 • Published 2 months ago

timepicker.js v4.1.0

Weekly downloads
173
License
MIT
Repository
github
Last release
2 months ago

TimePicker.js

NPM Version NPM Downloads npm bundle size GitHub Actions Workflow Status GitHub Release Date

A lightweight, customizable, TimePicker.

Timepicker anim

Demo

JSFiddle StackBlitz

How to use it?

NPM
npm i timepicker.js
CDN Hosted - jsDelivr

Load:

<script src="https://cdn.jsdelivr.net/npm/timepicker.js/dist/timepicker.iife.min.js"></script>
Instantiate with some options and listen to changes
const timepicker = new TimePicker('#click-trigger', {
    theme: 'dark',
    lang: 'pt',
})
timepicker.on('change', (evt) => {
    console.log(evt)

    // {
    //     hour: string;
    //     minute: string;
    //     element: HTMLElement;
    // }
})

API

Constructor

new TimePicker(target, options)

target can be:

{String|Element} String or DOM node.

options is an object with the following possible properties:
  • theme: 'dark'; Theme color
  • lang: 'en'; Header language

Methods

timepicker.show()

To be used programatically. Same for hide().

All targets passed to the constructor will be shown.

timepicker.hide()

Events

timepicker.on('open', function (evt) {});

timepicker.on('close', function (evt) {});

timepicker.on('change', function (evt) {});

Themes

  • dark
  • red
  • pink
  • purple
  • deep-purple
  • indigo
  • blue
  • light-blue
  • cyan
  • teal
  • green
  • light-green
  • lime
  • yellow
  • amber
  • orange
  • deep-orange
  • brown
  • blue-grey
4.1.0

2 months ago

4.0.1

2 months ago

4.0.0

2 months ago

4.0.2

2 months ago

4.0.0-0

2 months ago

4.0.0-1

2 months ago

3.1.0

3 years ago

3.0.0

4 years ago

2.6.0

4 years ago

2.5.0

5 years ago

2.4.0

6 years ago

2.3.0

6 years ago

2.1.0

8 years ago

2.0.1

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago