String. Default: H:mm
Time format. Possible tokens are: H
,h
,m
,a
.
If set H
or HH
- it's 24h format, central link works as 0-11 / 12-23 toggle.
If set h
or hh
- it's 12h format, central link works as AM / PM toggle.
String. Default: focus
How to trigger clockface.
Possible values: focus|manual
.
If set focus
it's applied only when attached to input
.
Initializes widget.
$('#time').clockface({format: 'HH:mm'});
Arguments:
Shows widget.
$('#time').clockface('show', '12:30');
Hides widget.
$('#time').clockface('hide');
Arguments:
Toggles show/hide.
$('#time').clockface('toggle');
Arguments:
Sets time of widget.
$('#time').clockface('setTime', '2:30');
Arguments:
Returns time in specified format. If asObject = true returns object containing hour
,
minute
and ampm
values.
var s = $('#time').clockface('getTime');
Fires when widget was shown.
$('#time').on('shown.clockface', function(e, data) { alert(data.hour); });
All events have second parameter data with current hour
,
minute
and ampm
values.
Fires when widget was hidden.
Fires every time when user picks hour, minute or am/pm.
markup:
js: