Skip to main content

Function: compareDate()

compareDate(a, b): number

Defined in: src/lib/dates/index.ts:153

Three-way comparison suitable as an Array.prototype.sort comparator.

Parameters​

a​

CalendarDate

First date.

b​

CalendarDate

Second date.

Returns​

number

-1 if a is before b, 0 if the same calendar day, 1 if a is after b.