@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.
15 lines • 657 B
TypeScript
/**
* Return whether `value1` represents an instant strictly before `value2`.
*
* - Uses Temporal.Instant.compare to compare instants.
* - Returns false if either input is invalid.
*
* @param value1 first UTC datetime string
* @param value2 second UTC datetime string
* @returns `true` if `value1` is before `value2`, otherwise `false`
*
* @example isBeforeUtc("2024-03-17T14:30:45Z", "2024-03-17T15:30:45Z") // true
* @example isBeforeUtc("2024-03-17T14:30:45Z", "2024-03-17T14:30:45Z") // false
* @example isBeforeUtc("2024-03-17T14:30:45Z", "invalid") // false
*/
export declare function isBeforeUtc(value1: string, value2: string): boolean;