Reference Source
import {Clock} from '@adobe/coral-spectrum'
public class | source

Clock

Expression Extends:

class Clock extends BaseFormField(BaseComponent(HTMLElement))

A Clock component that can be used as a time selection form field. Leverages momentJS if loaded on the page.

See:

Example:

Markup
<coral-clock></coral-clock>
JS constructor
new Coral.Clock();

Static Member Summary

Static Public Members
public static

Returns Clock variants.

Member Summary

Public Members
public

Whether this field is disabled or not.

public

The format used to display the selected time to the user.

public

invalid: *

Inherited from BaseFormField#invalid.

public

Inherited from BaseFormField#labelledBy.

public

Name used to submit the data in a form.

public

Whether this field is readOnly or not.

public

Whether this field is required or not.

public

This field's current value.

  • "" by default.

public

The current value as a Date.

public

The format to use on expressing the time as a string on the value attribute.

public

The clock's variant. See ClockVariantEnum.

  • ClockVariantEnum.DEFAULT by default.
  • reflected

Method Summary

Public Methods
public

focus()

Static Public Members

public static variant: ClockVariantEnum: * source

Returns Clock variants.

Public Members

public disabled: Boolean source

Whether this field is disabled or not.

  • false by default.
  • reflected

public displayFormat: String source

The format used to display the selected time to the user. If the user manually types a time, this format will be used to parse the value. 'HH:mm' is supported by default. Include momentjs to support additional format string options see http://momentjs.com/docs/#/displaying/.

  • "HH:mm" by default.
  • reflected

public invalid: * source

Inherited from BaseFormField#invalid.

public labelledBy: * source

Inherited from BaseFormField#labelledBy.

public name: String source

Name used to submit the data in a form.

  • "" by default.
  • reflected

public readOnly: Boolean source

Whether this field is readOnly or not. Indicating that the user cannot modify the value of the control.

  • false by default.
  • reflected

public required: Boolean source

Whether this field is required or not.

  • false by default.
  • reflected

public value: String source

This field's current value.

  • "" by default.

public valueAsDate: Date source

The current value as a Date. If the value is "" or an invalid date, null will be returned.

  • null by default.

public valueFormat: String source

The format to use on expressing the time as a string on the value attribute. The value will be sent to the server using this format. If an empty string is provided, then the default value per type will be used. 'HH:mm' is supported by default. Include momentjs to support additional format string options see http://momentjs.com/docs/#/displaying/.

  • "HH:mm" by default.
  • reflected

public variant: String source

The clock's variant. See ClockVariantEnum.

  • ClockVariantEnum.DEFAULT by default.
  • reflected

Public Methods

public focus() source