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

Function minDate

packages/@internationalized/date/src/queries.ts:351–360  ·  view source on GitHub ↗
(
  a?: A | null,
  b?: B | null
)

Source from the content-addressed store, hash-verified

349
350/** Returns the lesser of the two provider dates. */
351export function minDate<A extends DateValue, B extends DateValue>(
352 a?: A | null,
353 b?: B | null
354): A | B | null | undefined {
355 if (a && b) {
356 return a.compare(b) <= 0 ? a : b;
357 }
358
359 return a || b;
360}
361
362/** Returns the greater of the two provider dates. */
363export function maxDate<A extends DateValue, B extends DateValue>(

Callers 4

useRangeCalendarStateFunction · 0.90
constrainStartFunction · 0.90
constrainValueFunction · 0.90
queries.test.jsFile · 0.85

Calls 1

compareMethod · 0.45

Tested by

no test coverage detected