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 props | Value(s) | Description |
---|---|---|
value | string / null | Actual field value. |
onChange | (value: string) => void | Triggered when the time changes. |
slots | string[] | Slots displayed in selector. |
disablePast | boolean / null | Remove 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
).