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.

18 lines • 848 B
/** * Return true if two PlainTime ISO strings represent the same time components. * * - Compares all time components: hour, minute, second, millisecond, microsecond, nanosecond. * - Returns false if either input is invalid. * * @param value1 first ISO PlainTime string * @param value2 second ISO PlainTime string * @returns boolean indicating whether both times are equal component-wise * * @example areTimesEqual("12:34:56", "12:34:56") // true * @example areTimesEqual("12:34:56", "12:34:57") // false * @example areTimesEqual("12:34:56.789", "12:34:56.789") // true * @example areTimesEqual("12:34:56.789", "12:34:56.790") // false * @example areTimesEqual("invalid", "12:34:56") // false * @example areTimesEqual("12:34:56", "invalid") // false */ export declare function areTimesEqual(value1: string, value2: string): boolean;