isBeforeDate
Signature
Section titled “Signature”isBeforeDate(value1: string, value2: string): booleanReturn true when value1 is strictly before value2 for PlainDate values.
- Uses Temporal.PlainDate.compare to compare dates.
- Returns false if either input is invalid.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value1 | string | ISO PlainDate string for the first value |
value2 | string | ISO PlainDate string for the second value |
Returns
Section titled “Returns”boolean indicating whether value1 < value2
Examples
Section titled “Examples”import { isBeforeDate } from "@northguild/gmt/plain/compare";
isBeforeDate("2024-02-28", "2024-02-29") // true