TimePicker Input

Time picker input control. You can write inside and/or choose a time

Controlled

import { Button } from "swash/Button";
import { Tooltip } from "swash/Tooltip";

() => (
    <Tooltip tooltip="Tooltip" delay={2000}>
        <Button>Reference</Button>
    </Tooltip>
);

API

Props

React propsValue(s)Description
valuestring / nullActual field value.
onChange(value: string) => voidTriggered when the time changes.
slotsstring[]Slots displayed in selector.
disablePastboolean / nullRemove past slots

Additional exports

generateSlots(): string[]

Generate the default slots (30 minutes time intervals) used in the time selector.

parseFullTime(value: string | null): string | null

Convert the short time value (HH:mm) into a full time value(HH:mm:ss).

formatFullTime(value: string | null): string | null

Convert the full time value (HH:mm:ss) into a short time value (HH:mm).

checkIsValidFullTimeValue(value: string | null): boolean

Check is the value is a valid full time value (HH:mm:ss).