component-clock

Clock UI component for use in time-picker

npm install component-clock
1 downloads in the last day
1 downloads in the last week
6 downloads in the last month

clock

Clock UI component for use in time-picker

Clock

Click here to see online demo.

Installation

$ component install code42day/clock

Example

var Clock = require('clock');
var clock = new Clock;
clock.el.appendTo('body');
clock.select({
    hour: 11,
    minute: 30
});

Events

  • change (time, complete) - when the selected time is modified time is an object with hour and minute properties, complete is true only if both hours and minutes have been clicked by the user

API

Clock#select(time)

Select the given time ({ hour, minute }).

Clock#min(minTime)

Define the minimum time selectable with this clock (inclusive). Time values smaller than minTime are rendered with invalid class. All change events are generated only for values larger or equal to minTime.

Clock#max(maxTime)

Define the maximum time selectable with this clock (inclusive). Time values larger than maxTime are rendered with invalid class. All change events are generated only for values smaller or equal to maxTime.

License

MIT

npm loves you