MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / isBefore

Function isBefore

core/src/components/datetime/utils/comparison.ts:17–26  ·  view source on GitHub ↗
(baseParts: DatetimeParts, compareParts: DatetimeParts)

Source from the content-addressed store, hash-verified

15 * Returns true is the selected day is before the reference day.
16 */
17export const isBefore = (baseParts: DatetimeParts, compareParts: DatetimeParts) => {
18 return !!(
19 baseParts.year < compareParts.year ||
20 (baseParts.year === compareParts.year && baseParts.month < compareParts.month) ||
21 (baseParts.year === compareParts.year &&
22 baseParts.month === compareParts.month &&
23 baseParts.day !== null &&
24 baseParts.day < compareParts.day!)
25 );
26};
27
28/**
29 * Returns true is the selected day is after the reference day.

Callers 10

DatetimeClass · 0.90
getClosestValidDateFunction · 0.90
generateTimeFunction · 0.90
generateMonthsFunction · 0.90
clampDateFunction · 0.90
isDayDisabledFunction · 0.90
isMonthDisabledFunction · 0.90
comparison.spec.tsFile · 0.90
warnIfValueOutOfBoundsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected