@burglekitt/gmt
Version:
Temporal-based date and time utilities with timezone support and polyfill integration
16 lines (15 loc) • 813 B
TypeScript
/**
* Return whether `value1` represents an instant strictly before `value2`.
*
* - Both inputs must be valid zoned ISO 8601 datetime strings.
* - Comparison is performed using Temporal.Instant (same instant semantics), so differing timeZone representations but the same instant will compare as equal.
* - Invalid inputs return `false`.
*
* @param value1 first zoned datetime string
* @param value2 second zoned datetime string
* @returns `true` if `value1` is before `value2`, otherwise `false`
*
* @example isBeforeZoned("2024-03-17T14:30:45-05:00[America/New_York]", "2024-03-17T15:30:45-05:00[America/New_York]") // true
* @example isBeforeZoned("invalid", "2024-03-17T14:30:45-05:00[America/New_York]") // false
*/
export declare function isBeforeZoned(value1: string, value2: string): boolean;