UseIsBefore
katanakit-js / useIsBefore
Function: useIsBefore()
Section titled “Function: useIsBefore()”function useIsBefore(date1, date2): boolean;Defined in: core/services/dates.service.ts:689
Checks whether date1 is before date2.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
date1 |
string | PlainDate |
First date (ISO string or PlainDate). |
date2 |
string | PlainDate |
Second date (ISO string or PlainDate). |
Returns
Section titled “Returns”boolean
true if date1 is strictly before date2.
Example
Section titled “Example”useIsBefore("2024-01-01", "2024-06-15"); // true