isBeforeTime
Signature
Section titled “Signature”isBeforeTime(value1: string, value2: string): booleanimport { isBeforeTime } from "@northguild/gmt/plain/compare";Return true when value1 is strictly before value2 for PlainTime values.
- Uses Temporal.PlainTime.compare to compare times.
- Returns false if either input is invalid.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value1 |
string |
ISO PlainTime string for the first value |
value2 |
string |
ISO PlainTime string for the second value |
Returns
Section titled “Returns”boolean indicating whether value1 < value2
Examples
Section titled “Examples”isBeforeTime("12:34:56", "13:34:56") // trueisBeforeTime("12:34:56", "12:34:56") // falseisBeforeTime("13:34:56", "12:34:56") // falseisBeforeTime("invalid", "12:34:56") // falseisBeforeTime("12:34:56", "invalid") // false