timepicker-ui
4.7.0GitHub
timepicker-ui
Features / Custom Labels

Custom Labels

Customize all text labels for localization

Button Labels

#

Customize OK and Cancel button text:

const picker = new TimepickerUI(input, {
labels: {
ok: 'Confirm',
cancel: 'Close'
}
});
picker.create();

AM/PM Labels

#

Customize AM and PM labels:

const picker = new TimepickerUI(input, {
clock: { type: '12h' },
labels: {
am: 'a.m.',
pm: 'p.m.'
}
});
picker.create();

Clock View Title

#

Change the heading of the clock face view with labels.clockTitle:

const picker = new TimepickerUI(input, {
labels: { clockTitle: 'Choose Your Time' }
});
picker.create();

Keyboard View Labels

#

Change the labels of the keyboard view. labels.hour and labels.minute also name the fields for screen readers:

const picker = new TimepickerUI(input, {
ui: { initialView: 'keyboard' },
labels: {
hour: 'Hours',
minute: 'Minutes',
keyboardTitle: 'Set Time'
}
});
picker.create();

Polish Localization

#

Example with Polish labels:

const picker = new TimepickerUI(input, {
labels: {
ok: 'Zatwierdź',
cancel: 'Anuluj',
clockTitle: 'Wybierz godzinę'
}
});
picker.create();
Esc