@burglekitt/gmt
Version:
Temporal-based date and time utilities with timezone support and polyfill integration
16 lines (15 loc) • 765 B
TypeScript
/**
* Compare two zoned datetime strings for exact local-field equality.
*
* - Inputs must be valid ISO 8601 zoned datetime strings.
* - Returns `true` when year/month/day/hour/minute/second/millisecond/microsecond/nanosecond and IANA timeZone id all match; otherwise `false`.
* - Invalid inputs return `false`.
*
* @param value1 first zoned datetime string
* @param value2 second zoned datetime string
* @returns boolean indicating whether the two zoned datetimes are equal
*
* @example areZonedEqual("2024-02-29T12:34:56.789+00:00[UTC]", "2024-02-29T12:34:56.789+00:00[UTC]") // true
* @example areZonedEqual("invalid", "2024-02-29T12:34:56.789+00:00[UTC]") // false
*/
export declare function areZonedEqual(value1: string, value2: string): boolean;