Class IgxTimePickerComponent

Hierarchy

Hierarchy

  • PickerBaseDirective
    • IgxTimePickerComponent

Implements

  • IgxTimePickerBase
  • ControlValueAccessor
  • OnInit
  • OnDestroy
  • AfterViewInit
  • Validator

Constructors

Properties

closed: EventEmitter<IBaseEventArgs> = ...

Emitted after the calendar has closed.

Example

<igx-date-picker (closed)="handleClosed($event)"></igx-date-picker>
closing: EventEmitter<IBaseCancelableBrowserEventArgs> = ...

Emitted when the calendar has started closing, cancelable.

Example

<igx-date-picker (closing)="handleClosing($event)"></igx-date-picker>
densityChanged: EventEmitter<IDensityChangedEventArgs> = ...
disabled: boolean = false

Enables or disables the picker.

Example

<igx-date-picker [disabled]="'true'"></igx-date-picker>
displayFormat: string

The format used when editable input is not focused. Defaults to the inputFormat if not set.

Remarks

Uses Angular's DatePipe.

Example

<igx-time-picker displayFormat="mm:ss"></igx-time-picker>
element: ElementRef<any>
formatter: ((val) => string)

Gets/Sets a custom formatter function on the selected or passed date.

Example

<igx-time-picker [value]="date" [formatter]="formatter"></igx-time-picker>

Type declaration

    • (val): string
    • Parameters

      • val: Date

      Returns string

headerOrientation: PickerHeaderOrientation = PickerHeaderOrientation.Horizontal

Sets the orientation of the picker's header.

Remarks

Available in dialog mode only. Default value is horizontal.

<igx-time-picker [headerOrientation]="'vertical'"></igx-time-picker>
id: string = ...

Sets the value of the id attribute.

<igx-time-picker [id]="'igx-time-picker-5'" [displayFormat]="h:mm tt" ></igx-time-picker>
inputFormat: string = DateTimeUtil.DEFAULT_TIME_INPUT_FORMAT

The expected user input format and placeholder.

Remarks

Default is hh:mm tt

Example

<igx-time-picker inputFormat="HH:mm"></igx-time-picker>
mode: PickerInteractionMode = PickerInteractionMode.DropDown

Gets/Sets the interaction mode - dialog or drop down.

Example

<igx-time-picker mode="dialog"></igx-time-picker>
opened: EventEmitter<IBaseEventArgs> = ...

Emitted after the calendar has opened.

Example

<igx-date-picker (opened)="handleOpened($event)"></igx-date-picker>
opening: EventEmitter<IBaseCancelableBrowserEventArgs> = ...

Emitted when the calendar has started opening, cancelable.

Example

<igx-date-picker (opening)="handleOpening($event)"></igx-date-picker>
outlet: ElementRef<any> | IgxOverlayOutletDirective

The container used for the pop-up element.

Example

<div igxOverlayOutlet #outlet="overlay-outlet"></div>
<!-- ... -->
<igx-date-picker [outlet]="outlet"></igx-date-picker>
<!-- ... -->
overlaySettings: OverlaySettings

Overlay settings used to display the pop-up element.

Example

<igx-date-picker [overlaySettings]="customOverlaySettings"></igx-date-picker>
placeholder: string = ''

Sets the placeholder of the picker's input.

Example

<igx-date-picker [placeholder]="'Choose your date'"></igx-date-picker>
selected: EventEmitter<Date> = ...

Emitted after a selection has been done.

Example

<igx-time-picker (selected)="onSelection($event)"></igx-time-picker>
spinLoop: boolean = true

Sets whether the seconds, minutes and hour spinning will loop back around when end value is reached. By default it's set to true.

<igx-time-picker [spinLoop]="false"></igx-time-picker>
tabIndex: string | number

Gets/Sets the default template editor's tabindex.

Example

<igx-date-picker [tabIndex]="1"></igx-date-picker>
validationFailed: EventEmitter<IgxTimePickerValidationFailedEventArgs> = ...

Emitted when the user types/spins invalid time in the time-picker editor.

Example

<igx-time-picker (validationFailed)="onValidationFailed($event)"></igx-time-picker>
valueChange: EventEmitter<string | Date> = ...

Emitted when the picker's value changes.

Remarks

Used for two-way bindings.

Example

<igx-time-picker [(value)]="date"></igx-time-picker>

Accessors

Methods

  • Closes the dropdown/dialog.

    <igx-time-picker #timePicker></igx-time-picker>
    
    @ViewChild('timePicker', { read: IgxTimePickerComponent }) picker: IgxTimePickerComponent;
    picker.close();

    Returns void

  • Sets the --component-size CSS variable based on the value of Display Density

    Returns "var(--ig-size, var(--ig-size-small))" | "var(--ig-size, var(--ig-size-medium))" | "var(--ig-size, var(--ig-size-large))"

  • Opens the picker's dialog UI.

    Parameters

    • Optional settings: OverlaySettings

      OverlaySettings - the overlay settings to use for positioning the drop down or dialog container according to

      <igx-time-picker #picker [value]="date"></igx-time-picker>
      <button type="button" igxButton (click)="picker.open()">Open Dialog</button>

    Returns void