MCPcopy Create free account
hub / github.com/angular/components / isInRange

Function isInRange

src/material/datepicker/calendar-body.ts:658–672  ·  view source on GitHub ↗

Checks whether a value is inside of a range.

(
  value: number,
  start: number | null,
  end: number | null,
  rangeEnabled: boolean,
)

Source from the content-addressed store, hash-verified

656
657/** Checks whether a value is inside of a range. */
658function isInRange(
659 value: number,
660 start: number | null,
661 end: number | null,
662 rangeEnabled: boolean,
663): boolean {
664 return (
665 rangeEnabled &&
666 start !== null &&
667 end !== null &&
668 start !== end &&
669 value >= start &&
670 value <= end
671 );
672}
673
674/**
675 * Extracts the element that actually corresponds to a touch event's location

Callers 3

_isInRangeMethod · 0.85
_isInComparisonRangeMethod · 0.85
_isInPreviewMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected