# isValidZonedInterval

Industry: Core

## Signature

```ts
isValidZonedInterval(start: string, end: string): boolean
```

Return true if `start` and `end` form a valid zoned interval — both valid ISO ZonedDateTime strings (`isValidZonedDateTime`) and the instant at `start` is &lt;= the instant at `end`.

- Both inputs must be valid ISO 8601 zoned datetime strings.
- Equal `start === end` is valid.
- Comparison is done by instant, so intervals spanning DST transitions are compared by absolute time.
- Reads each endpoint as `isValidZonedDateTime` does: the zone bracket is the only annotation, and a calendar (`[u-ca=iso8601]`, `[u-ca=hebrew]`) or an elective one (`[foo=bar]`) returns `false`. `isValidCalendarZonedInterval` reads the calendar.
- Invalid input, malformed strings, or leap-second strings return `false`.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `start` | `string` | ISO ZonedDateTime string (interval start) |
| `end` | `string` | ISO ZonedDateTime string (interval end) |

## Returns

true if start and end form a valid zoned interval, or false on invalid input

## Examples

```ts
import { isValidZonedInterval } from "@northguild/gmt/zoned/interval";

isValidZonedInterval("2024-01-01T10:00:00+00:00[UTC]", "2024-12-31T23:59:59+00:00[UTC]") // true
```

## Source

[zoned/interval/validate/isValidZonedInterval.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/zoned/interval/validate/isValidZonedInterval.ts)
