timepicker-ui
4.7.0GitHub
timepicker-ui
Basic Examples / 24h Format

24h Format

Examples using 24-hour clock format (military time)

Basic 24h Format

#

Enable 24-hour format (no AM/PM):

const picker = new TimepickerUI(input, {
clock: { type: '24h' }
});
picker.create();

With Current Time

#

Initialize with current time in 24h format:

const picker = new TimepickerUI(input, {
clock: {
type: '24h',
defaultTime: 'now'
}
});
picker.create();

Disabled Hours (24h)

#

Disable specific hours in 24h format (0-23):

const picker = new TimepickerUI(input, {
clock: {
type: '24h',
disabledTime: {
hours: [0, 1, 2, 3, 22, 23]
}
}
});
picker.create();

Time Range Restriction

#

Disable time ranges in 24h format:

const picker = new TimepickerUI(input, {
clock: {
type: '24h',
disabledTime: {
ranges: '00:00 - 08:00'
}
}
});
picker.create();

With Hour Increments

#

Set hour increments in 24h format:

const picker = new TimepickerUI(input, {
clock: {
type: '24h',
incrementHours: 2,
incrementMinutes: 15
}
});
picker.create();
Esc