TimePicker(container, optionsopt)

new TimePicker(container, optionsopt)

Parameters:
Name Type Attributes Description
container string | jQuery | HTMLElement

Container element

options Object <optional>

Options for initialization

Properties
Name Type Attributes Default Description
initialHour number <optional>
0

Initial setting value of hour

initialMinute number <optional>
0

Initial setting value of minute

hourStep number <optional>
1

Step value of hour

minuteStep number <optional>
1

Step value of minute

inputType string <optional>
'selectbox'

'selectbox' or 'spinbox'

format string <optional>
'h:m'

hour, minute format for display

showMeridiem boolean <optional>
true

Show meridiem expression?

disabledHours Array <optional>
[]

Registered Hours is disabled.

meridiemPosition string <optional>
'right'

Set location of the meridiem element. If this option set 'left', the meridiem element is created in front of the hour element.

language string <optional>
'en'

Set locale texts

usageStatistics Boolean <optional>
true|false

send hostname to google analytics [default value is true]

Example
var timepicker = new tui.TimePicker('#timepicker-container', {
    initialHour: 15,
    initialMinute: 13,
    inputType: 'selectbox',
    showMeridiem: false
});

Members

static localeTexts :object

Locale text data

Example
var TimePicker = tui.TimePicker; // or require('tui-time-picker');

TimePicker.localeTexts['customKey'] = {
    am: 'a.m.',
    pm: 'p.m.'
};

var instance = new tui.TimePicker('#timepicker-container', {
    language: 'customKey',
});

Methods

changeLanguage(language)

Change locale text of meridiem by language code

Parameters:
Name Type Description
language string

Language code

destroy()

Destroy

getHour() → {number}

Get hour

Returns:
number -

hour - (0~23)

getHourStep() → {number}

Get step of hour

Returns:
number -

Step of hour

getMinute() → {number}

Get minute

Returns:
number -

minute

getMinuteStep() → {number}

Get step of minute

Returns:
number -

Step of minute

hide()

Hide time picker element

setHour(hour) → {boolean}

Set hour

Parameters:
Name Type Description
hour number

for time picker - (0~23)

Returns:
boolean -

result of set time

setHourStep(step)

Set step of hour

Parameters:
Name Type Description
step array

Step to create items of hour

setMinute(minute) → {boolean}

Set minute

Parameters:
Name Type Description
minute number

for time picker

Returns:
boolean -

result of set time

setMinuteStep(step)

Set step of minute

Parameters:
Name Type Description
step array

Step to create items of minute

setTime(hour, minute)

Set time

Parameters:
Name Type Description
hour number

for time picker - (0~23)

minute number

for time picker

show()

Show time picker element

Events

change

Change event - TimePicker