areZonedEqual
Signature
Section titled “Signature”areZonedEqual(value1: string, value2: string): booleanimport { areZonedEqual } from "@northguild/gmt/zoned/compare";Compare two zoned datetime strings for exact local-field equality.
- Inputs must be valid ISO 8601 zoned datetime strings.
- Returns
truewhen year/month/day/hour/minute/second/millisecond/microsecond/nanosecond and IANA timeZone id all match; otherwisefalse. - Invalid inputs return
false.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value1 |
string |
first zoned datetime string |
value2 |
string |
second zoned datetime string |
Returns
Section titled “Returns”boolean indicating whether the two zoned datetimes are equal
Examples
Section titled “Examples”areZonedEqual("2024-02-29T12:34:56.789+00:00[UTC]", "2024-02-29T12:34:56.789+00:00[UTC]") // trueareZonedEqual("invalid", "2024-02-29T12:34:56.789+00:00[UTC]") // false