MCPcopy Create free account
hub / github.com/adobe/react-spectrum / isInvalid

Function isInvalid

packages/react-stately/src/calendar/utils.ts:24–33  ·  view source on GitHub ↗
(
  date: DateValue,
  minValue?: DateValue | null,
  maxValue?: DateValue | null
)

Source from the content-addressed store, hash-verified

22import {DateValue} from './types';
23
24export function isInvalid(
25 date: DateValue,
26 minValue?: DateValue | null,
27 maxValue?: DateValue | null
28): boolean {
29 return (
30 (minValue != null && date.compare(minValue) < 0) ||
31 (maxValue != null && date.compare(maxValue) > 0)
32 );
33}
34
35export function alignCenter(
36 date: CalendarDate,

Callers 5

useCalendarStateFunction · 0.90
isInvalidFunction · 0.90
useRangeCalendarStateFunction · 0.90
isInvalidFunction · 0.90
isDateInvalidFunction · 0.90

Calls 1

compareMethod · 0.45

Tested by

no test coverage detected