UNPKG

@northguild/gmt

Version:

Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.

13 lines • 592 B
/** * Return the earliest (minimum) of the given PlainDateTime values. * * - Returns null if the array is empty or contains no valid datetimes. * - Validation is performed on each item in the array. * * @param dateTimes Array of ISO PlainDateTime strings (e.g. "2024-03-10T12:00:00") * @returns The earliest datetime string, or null on invalid input * * @example minDateTime(["2024-03-10T12:00:00", "2024-03-15T12:00:00", "2024-03-12T12:00:00"]) // "2024-03-10T12:00:00" * @example minDateTime([]) // null */ export declare function minDateTime(dateTimes: string[]): string | null;