Rxova
Skip to content

UseDateInputResult

clear: () => void;

Clear the whole field.

void


clearSegment: (segment) => void;

Clear one segment.

ParameterType
segmentDateSegment

void


complete: boolean;

Every segment filled in.


disabled: boolean;

focused:
| DateSegment
| null;

The segment that currently has focus.


focusSegment: (segment) => void;
ParameterType
segmentDateSegment

void


handleBlur: (event) => void;
ParameterType
eventFocusEvent<HTMLElement>

void


handleSegmentFocus: (segment, event) => void;
ParameterType
segmentDateSegment
eventFocusEvent<HTMLElement>

void


ids: object & Record<DateSegment, string>;
group: string;
hidden: string;

max: string | undefined;

min: string | undefined;

Usable bounds after coercion — a min after max leaves both undefined.


months: string[];

Localised month names, for the month segment’s aria-valuetext.


moveFocus: (from, delta) => void;

Move focus by delta segments, clamped at the ends.

ParameterType
fromDateSegment
deltanumber

void


order: DateSegment[];

Just the segment types, in display order.


outOfRange: boolean;

Complete, but outside min/max.


parts: DateParts;

What is currently typed, segment by segment.


pieces: DatePiece[];

The segments and separators for the locale, in display order.


rangeFor: (segment) => object;

Inclusive bounds for one segment, given what else is filled in.

ParameterType
segmentDateSegment

object

max: number;
min: number;

readOnly: boolean;

segmentRefs: object;

Structural rather than RefObject: in @types/react 18 RefObject.current is readonly, in 19 it is mutable. Declaring the shape keeps this assignable under both, which matters because react >= 18 is a peer.

current: Partial<Record<DateSegment, HTMLElement | null>>;

setSegment: (segment, next) => void;
ParameterType
segmentDateSegment
nextnumber | null

void


step: (segment, delta) => void;

Arrow-key stepping, wrapping at the ends.

ParameterType
segmentDateSegment
deltanumber

void


typeDigit: (segment, digit) => void;

Feed one typed digit into a segment; auto-advances when it cannot take more.

ParameterType
segmentDateSegment
digitstring

void


value: string | null;

YYYY-MM-DD when every segment is filled and the date is real, else null.