timepicker-ui
4.7.0GitHub
timepicker-ui
Features / Seconds

Seconds

Pick hours, minutes and seconds with clock.showSeconds. Full reference on the Seconds docs page.

Version

Seconds need timepicker-ui 4.5.0 or later.

Clock with Seconds (12h)

#

Pick an hour, then a minute. The face then switches to seconds. The value looks like 02:30:15 PM.

const picker = new TimepickerUI(input, {
clock: { showSeconds: true }
});
picker.create();

24h with a 5-Second Step

#

incrementSeconds sets the step on the seconds face and the keyboard. The value looks like 14:30:15.

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

No Auto-Switch to Seconds

#

With autoSwitchToSeconds: false, the face stays on minutes. Click the seconds field in the header to set seconds.

const picker = new TimepickerUI(input, {
clock: {
showSeconds: true,
autoSwitchToSeconds: false
}
});
picker.create();

Wheel with Seconds

#

Three columns: hours, minutes and seconds.

import { TimepickerUI, PluginRegistry } from 'timepicker-ui';
import { WheelPlugin } from 'timepicker-ui/plugins/wheel';
PluginRegistry.register(WheelPlugin);
const picker = new TimepickerUI(input, {
ui: { mode: 'wheel' },
clock: { showSeconds: true }
});
picker.create();

Compact Wheel Popover with Seconds

#

Columns HH : MM : SS in a popover. With placement: 'auto' it opens below the input when there is room, otherwise above.

import { TimepickerUI, PluginRegistry } from 'timepicker-ui';
import { WheelPlugin } from 'timepicker-ui/plugins/wheel';
PluginRegistry.register(WheelPlugin);
const picker = new TimepickerUI(input, {
ui: { mode: 'compact-wheel' },
clock: { type: '24h', showSeconds: true, incrementSeconds: 5 },
wheel: { placement: 'auto' }
});
picker.create();

Disabled Seconds

#

disabledTime.seconds blocks the same seconds in every minute. Here :55 to :59 cannot be picked.

const picker = new TimepickerUI(input, {
clock: {
showSeconds: true,
disabledTime: {
seconds: [55, 56, 57, 58, 59]
}
}
});
picker.create();

Disabled Range with Seconds

#

Blocks 10:00:30 AM up to and including 10:05:59 AM. Minute 10:00 stays selectable for seconds :00 to :29.

const picker = new TimepickerUI(input, {
clock: {
type: '12h',
showSeconds: true,
disabledTime: {
ranges: '10:00:30 AM - 10:05 AM'
}
}
});
picker.create();

Range with Seconds

#

range:confirm carries durationSeconds. minDuration stays in minutes but is compared to the second, so this range must be at least 60 seconds long.

import { TimepickerUI, PluginRegistry } from 'timepicker-ui';
import { RangePlugin } from 'timepicker-ui/plugins/range';
PluginRegistry.register(RangePlugin);
const picker = new TimepickerUI(input, {
clock: { type: '24h', showSeconds: true },
range: { enabled: true, minDuration: 1 },
callbacks: {
onRangeConfirm: (data) => {
console.log(data.from, data.to, data.durationSeconds);
}
}
});
picker.create();

Keyboard View

#

Three editable fields, each with a caption. The captions here are in Polish. The seconds caption comes from labels.second.

const picker = new TimepickerUI(input, {
ui: { initialView: 'keyboard' },
clock: { type: '24h', showSeconds: true },
labels: {
keyboardTitle: 'Wpisz godzinę',
hour: 'Godzina',
minute: 'Minuta',
second: 'Sekunda',
cancel: 'Anuluj'
}
});
picker.create();
Esc