timeFormatstring The format of the time string displayed in the input and the menu items in the combobox. Available modifiers are:
h |
12 hour without leading 0. | hh |
12 hour with leading 0. |
H |
24 hour without leading 0. | HH |
24 hour with leading 0. |
m |
minutes without leading 0. | mm |
minutes with leading 0. |
s |
seconds without leading 0. | ss |
seconds with leading 0. |
p |
AM or PM |
$(document).ready(function(){
$('input.timepicker').timepicker({ timeFormat: 'h:mm:ss p' });
});defaultTimeA Date object, string or the word 'now'. Only the time parts (getHours, getMinutes) of the object are important. It must be a valid time, according to minTime, minHour, minMinutes, maxTime, maxHour and maxMinutes.
If 'now' is passed, the current time as returned by new Date() will be used as the default value.
minTimeA Date object or string. Only the time parts (getHours, getMinutes) of the object are important. Time entries before minTime won't be displayed/allowed.
minHourint. Time entries with an 24-hour part before minHour won't be displayed/allowed. Ignored if minTime is set.
minMinutesint Time entries with minutes part before minMinutes won't be displayed/allowed. Ignored if minTime is set.
maxTimeA Date object or string. Only the time parts (getHours, getMinutes) of the object are important. Time entries after minTime won't be displayed/allowed.
maxHourint. Time entries with an 24-hour part after maxHour won't be displayed/allowed. Ignored if maxTime is set.
maxMinutesint. Time entries with minutes part after maxHour won't be displayed/allowed. Ignored if maxTime is set.
startTimeA Date object or string. The time of the first item in the combobox when the input field is empty. If the input field is not empty the first item will be the next allowed time entry.
startHourint The 24-hour part of the first item in the combobox when the input field is emptye. If input field is not empty the first item will be the next allowed time entry. Ignored if startTime is set.
startMinutesint The minutes part of the first item in the combobox when the input field is emptye. If input field is not empty the first item will be the next allowed time entry. Ignored if startTime is set.
intervalint Separation in minutes between time entries in the dropdown menu.
$(document).ready(function(){
$('input.timepicker').timepicker({
timeFormat: 'HH:mm:ss',
minTime: '11:45:00' // 11:45:00 AM,
maxHour: 20,
maxMinutes: 30,
startTime: new Date(0,0,0,15,0,0) // 3:00:00 PM - noon
interval: 15 // 15 minutes
});
});dropdownboolean Whether the dropdown should be displayed or not.
dynamicboolean If a date is already selected and dynamic is true, the items in the dropdown will be arranged so that the first item is chronologically right after the selected time entry.
scrollbarboolean Whether the scrollbars should be displayed or not.
zindexint The value for the z-index property of the timepicker's container <div>.
changeEvent triggerd when the value of the input field changes. A Date object containing the selected time is passed as the first argument of the callback.
$(document).ready({
$('input.timepicker').timepicker({
change: function(time) {
// the input field
var element = $(this), text;
// get access to this Timepicker instance
var timepicker = element.timepicker();
text = 'Selected time is: ' + timepicker.format(time);
element.siblings('span.help-line').text(text);
}
});
});