import { KbqTimepickerModule } from '@koobiq/components/timepicker';

KbqTimepicker

directiveCopy link to KbqTimepicker
@Directive({ selector: 'input[kbqTimepicker]', exportAs: 'kbqTimepicker' })
class KbqTimepicker<D> implements KbqFormFieldControl<D>, ControlValueAccessor, Validator {
    readonly errorStateMatcher = input<ErrorStateMatcher>();
    readonly disabled = input<boolean>(false);
    readonly format = input<TimeFormats>(DEFAULT_TIME_FORMAT);
    readonly min = input<D | null>(null);
    readonly max = input<D | null>(null);
    readonly id = input<string | undefined>();
    readonly value = input<D | null | undefined>();
    readonly kbqValidationTooltip = input<KbqTooltipTrigger | undefined>();
    readonly incorrectInput = output<void>();
    get hasSelection(): boolean;
    get isFullFormat(): boolean;
    get isShortFormat(): boolean;
    get viewValue(): string;
    get ngControl(): any;
    selectionStart: number | null;
    selectionEnd: number | null;
    get timeFormatPlaceholder(): string;
    onInput: () => void;
    getSize(): number;
    focus(): void;
    focusChanged(isFocused: boolean): void;
    onBlur(): void;
    onPaste(event: ClipboardEvent): void;
    onKeyDown(event: KeyboardEvent): void;
    validate(control: AbstractControl): ValidationErrors | null;
    registerOnValidatorChange(fn: () => void): void;
}
errorStateMatcherinputCopy link to errorStateMatcherErrorStateMatcher

Object used to control when error messages are shown.

disabledinputCopy link to disabledboolean

Whether the timepicker is disabled. Also set by the bound form control.

formatinputCopy link to formatTimeFormats

Time format the input parses and renders. An unsupported value falls back to the default.

mininputCopy link to minD | null

Earliest time the control accepts. Anything the date adapter cannot read is treated as unset.

maxinputCopy link to maxD | null

Latest time the control accepts. Anything the date adapter cannot read is treated as unset.

idinputCopy link to idstring | undefined

Unique id of the element, generated when not provided.

valueinputCopy link to valueD | null | undefined

The time the control holds: set with [value], by the form control and by typing. The model value is adapted to the active zone, while the rendered text is owned by writeValue and by typing — a write made with emitModelToViewChange: false updates this signal without rewriting the text, and (valueChange) is not emitted for it.

kbqValidationTooltipinputCopy link to kbqValidationTooltipKbqTooltipTrigger | undefined

Tooltip shown for a moment whenever a keystroke is rejected.

localeOverridesinputCopy link to localeOverridesKbqPartialLocaleData | undefined

Localized strings for this element and its subtree, keyed by locale section. Every key is optional at every depth.

timeFormatPlaceholderCopy link to timeFormatPlaceholderstring

Localized placeholder

TimeFormats

enumCopy link to TimeFormats
enum TimeFormats {
    HHmmss = 'HH:mm:ss',
    HHmm = 'HH:mm'
}

TimeParts

enumCopy link to TimeParts
enum TimeParts {
    hours,
    minutes,
    seconds
}

AM_PM_FORMAT_REGEXP

constCopy link to AM_PM_FORMAT_REGEXP
const AM_PM_FORMAT_REGEXP: RegExp;

DEFAULT_TIME_FORMAT

constCopy link to DEFAULT_TIME_FORMAT
const DEFAULT_TIME_FORMAT: TimeFormats;

HOURS_MINUTES_REGEXP

constCopy link to HOURS_MINUTES_REGEXP
const HOURS_MINUTES_REGEXP: RegExp;

HOURS_MINUTES_SECONDS_REGEXP

constCopy link to HOURS_MINUTES_SECONDS_REGEXP
const HOURS_MINUTES_SECONDS_REGEXP: RegExp;

HOURS_ONLY_REGEXP

constCopy link to HOURS_ONLY_REGEXP
const HOURS_ONLY_REGEXP: RegExp;

HOURS_PER_DAY

constCopy link to HOURS_PER_DAY
const HOURS_PER_DAY: number;

kbqTimepickerLocaleConfigurationProvider

constCopy link to kbqTimepickerLocaleConfigurationProvider

Utility provider for KBQ_TIMEPICKER_LOCALE_CONFIGURATION. Only the strings you pass are overridden; the rest keep following the active locale.

const kbqTimepickerLocaleConfigurationProvider: (
    configuration: KbqDeepPartial<KbqTimepickerLocaleConfiguration>
) => Provider;

MINUTES_PER_HOUR

constCopy link to MINUTES_PER_HOUR
const MINUTES_PER_HOUR: number;

SECONDS_PER_MINUTE

constCopy link to SECONDS_PER_MINUTE
const SECONDS_PER_MINUTE: number;

TIMEFORMAT_PLACEHOLDERS

constCopy link to TIMEFORMAT_PLACEHOLDERS
const TIMEFORMAT_PLACEHOLDERS: { [timeFormat: string]: string };

TimeFormatToLocaleKeys

constCopy link to TimeFormatToLocaleKeys

Object that maps each time format to a related locale key

const TimeFormatToLocaleKeys: Record<TimeFormats, 'full' | 'short'>;
Suggestions for improvement
If you found a mistake or want to improve the article, create an issue on GitHub.