Class TimePicker

Allows users to select time values.

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(element?: HTMLElement, options?: any): TimePicker

Initializes a new instance of a TimePicker control.

constructor

Parameters

  • element?: HTMLElement optional

    The DOM element associated with the TimePicker control.

  • options?: any optional

    The set of options to be applied initially to the TimePicker control. The options are the following: clock.

Returns

TimePicker

Properties

public clock: string

Gets or sets the type of clock to display (12HourClock or 24HourClock). It defaults to the user setting.

public current: Date

Gets or sets the current time of the TimePicker. Note that the date value is always July 15, 2011.

public disabled: boolean

Specifies whether the TimePicker is disabled.

public element: HTMLElement

Gets the DOM element for the TimePicker.

public hourPattern: string

Gets or sets the display pattern for the hour. The default hour pattern is hour.integer(2). You can change the hour pattern by changing the number of integers displayed.

public minuteIncrement: number

Gets or sets the minute increment. For example, 15 specifies that the TimePicker minute control should display only the choices 00, 15, 30, 45.

public minutePattern: string

Gets or sets the display pattern for the minute. The default minute pattern is minute.integer(2). You can change the minute pattern by changing the number of integers displayed.

public periodPattern: string

Gets or sets the display pattern for the period. The default period pattern is period.abbreviated(2). You can change the period pattern by changing the number of integers displayed.

Methods

public addEventListener(type: string, listener: Function, capture?: boolean)

Adds an event listener.

Parameters

  • type: string

    The type (name) of the event.

  • listener: Function

    The function that handles the event.

  • capture?: boolean optional

    If true, specifies that capture should be initiated, otherwise false.

public dispatchEvent(type: string, eventProperties: any): boolean

Raises an event of the specified type and with additional properties.

Parameters

  • type: string

    The type (name) of the event.

  • eventProperties: any

    The set of additional properties to be attached to the event object when the event is raised.

Returns

boolean

true if preventDefault was called on the event, otherwise false.

public dispose()

Releases resources held by this TimePicker. Call this method when the TimePicker is no longer needed. After calling this method, the TimePicker becomes unusable.

public onchange(eventInfo: CustomEvent)

Occurs when any of the controls are changed by the user.

Parameters

  • eventInfo: CustomEvent

    An object that contains information about the event.

public raiseEvent(type: string, eventProperties: any): boolean

Raises an event of the specified type and with additional properties.

Parameters

  • type: string

    The type (name) of the event.

  • eventProperties: any

    The set of additional properties to be attached to the event object when the event is raised.

Returns

boolean

true if preventDefault was called on the event, otherwise false.

public removeEventListener(type: string, listener: Function, useCapture?: any)

Removes a listener for the specified event.

Parameters

  • type: string

    The name of the event for which to remove a listener.

  • listener: Function

    The listener.

  • useCapture?: any optional

    Optional. The same value that was passed to addEventListener for this listener. It may be omitted if it was omitted when calling addEventListener.