isAfterDate
Playground
call
result
Signature
Section titled “Signature”isAfterDate(value1: string, value2: string): booleanimport { isAfterDate } from "@northguild/gmt/plain/compare";Return true if the first ISO PlainDate string represents a date after the second.
- Uses Temporal.PlainDate.compare to compare dates.
- Returns false if either input is invalid.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value1 |
string |
first ISO PlainDate string |
value2 |
string |
second ISO PlainDate string |
Returns
Section titled “Returns”boolean indicating whether value1 is after value2
Examples
Section titled “Examples”isAfterDate("2024-03-01", "2024-02-29") // trueisAfterDate("2024-02-28", "2024-02-29") // falseisAfterDate("invalid", "2024-02-29") // falseisAfterDate("2024-02-29", "invalid") // false