@burglekitt/gmt
Version:
Temporal-based date and time utilities with timezone support and polyfill integration
14 lines (13 loc) • 508 B
TypeScript
/**
* 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.
*
* @param dates Array of ISO PlainDate strings (e.g. "2024-03-10")
* @returns The latest date string, or null on invalid input
*
* @example maxDate(["2024-03-10", "2024-03-15", "2024-03-12"]) // "2024-03-15"
* @example maxDate([]) // null
*/
export declare function maxDate(dates: string[]): string | null;