# Interval

Industry: Core, Workforce, Intermodal

A span of time between two ISO 8601 instant strings, half-open: `[start, end)`.

```ts
import type { Interval } from "@northguild/gmt";
```

## Members

| Member | Type | Description |
| --- | --- | --- |
| `start` | `string` | The first instant inside the interval, as an ISO 8601 instant string with an offset. |
| `end` | `string` | The first instant after the interval, as an ISO 8601 instant string with an offset; it is not itself inside. It may equal `start`, which makes the interval empty, but not precede it. |

## Definition

```ts
type Interval = {
  /** The first instant inside the interval, as an ISO 8601 instant string with an offset. */
  start: string;
  /**
   * The first instant after the interval, as an ISO 8601 instant string with an offset; it is
   * not itself inside. It may equal `start`, which makes the interval empty, but not precede it.
   */
  end: string;
};
```

## Used by

- [`clampInterval`](/gmt/reference/interval/calculate/clampInterval/)
- [`cronRuns`](/gmt/reference/recurrence/calculate/cronRuns/)
- [`demurrageClock`](/gmt/reference/intermodal/calculate/demurrageClock/)
- [`dutyDayFor`](/gmt/reference/workforce/calculate/dutyDayFor/)
- [`dutyTotals`](/gmt/reference/workforce/calculate/dutyTotals/)
- [`dutyViolations`](/gmt/reference/workforce/calculate/dutyViolations/)
- [`evaluateDutyLog`](/gmt/reference/workforce/calculate/evaluateDutyLog/)
- [`expandRecurrence`](/gmt/reference/recurrence/calculate/expandRecurrence/)
- [`intersectIntervals`](/gmt/reference/interval/calculate/intersectIntervals/)
- [`intervalContains`](/gmt/reference/interval/compare/intervalContains/)
- [`intervalsOverlap`](/gmt/reference/interval/compare/intervalsOverlap/)
- [`isValidInterval`](/gmt/reference/interval/validate/isValidInterval/)
- [`longestRun`](/gmt/reference/workforce/calculate/longestRun/)
- [`mergeIntervals`](/gmt/reference/interval/calculate/mergeIntervals/)
- [`operatingIntervals`](/gmt/reference/calendar/hours/operatingIntervals/)
- [`qualifyingRestPairs`](/gmt/reference/workforce/calculate/qualifyingRestPairs/)
- [`qualifyingRests`](/gmt/reference/workforce/calculate/qualifyingRests/)
- [`recurringWindows`](/gmt/reference/calendar/hours/recurringWindows/)
- [`splitIntervalAt`](/gmt/reference/interval/calculate/splitIntervalAt/)
- [`subtractIntervals`](/gmt/reference/interval/calculate/subtractIntervals/)
- [`sumIntervals`](/gmt/reference/interval/calculate/sumIntervals/)

## Source

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