maxDate
Signature
Section titled “Signature”maxDate(dates: string[]): stringimport { maxDate } from "@northguild/gmt/plain/calculate";Return the latest (maximum) of the given PlainDate values.
- Returns null if the array is empty or contains no valid dates.
- Validation is performed on each item in the array.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
dates |
string[] |
Array of ISO PlainDate strings (e.g. “2024-03-10”) |
Returns
Section titled “Returns”The latest date string, or null on invalid input
Examples
Section titled “Examples”maxDate(["2024-03-10", "2024-03-15", "2024-03-12"]) // "2024-03-15"maxDate([]) // null