# intervalEngulfsTime

Industry: Core

## Signature

```ts
intervalEngulfsTime(aStart: string, aEnd: string, bStart: string, bEnd: string): boolean
```

Return true when the half-open interval B `[bStart, bEnd)` lies within the half-open interval A `[aStart, aEnd)` — every clock time of B is also in A.

- Half-open: an interval holds every `t` with `start <= t < end`. B may start at A's start and end at A's end, because neither end is part of either interval.
- B must also overlap A, so an empty B (`bStart === bEnd`) counts only strictly inside A, never at an edge (CORE-6's `clampInterval` clamps it away there).
- Equivalent to 4-argument `intervalContainsTime(aStart, aEnd, bStart, bEnd)`.
- PlainTime has no day rollover: an interval never wraps past midnight. And because `end` is excluded, no interval *contains* `23:59:59.999999999` — containing it would need an `end` greater than it, and no PlainTime is. An interval may still *have* it as its `end`: `intervalContainsTime("09:00:00", "23:59:59.999999999", "23:00:00")` is `true`, while `intervalContainsTime("09:00:00", "23:59:59.999999999", "23:59:59.999999999")` is `false`.
- Uses `Temporal.PlainTime.compare` for comparison.
- Returns `false` if either interval is invalid (`start > end`).
- Returns `false` on invalid input (wrong type, malformed strings).

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `aStart` | `string` | ISO 8601 time string for the outer interval start |
| `aEnd` | `string` | ISO 8601 time string for the outer interval end (excluded) |
| `bStart` | `string` | ISO 8601 time string for the inner interval start |
| `bEnd` | `string` | ISO 8601 time string for the inner interval end (excluded) |

## Returns

true if B lies within A, or false on invalid input

## Examples

```ts
import { intervalEngulfsTime } from "@northguild/gmt/plain/interval";

intervalEngulfsTime("09:00:00", "17:00:00", "12:00:00", "13:00:00") // true
```

## Source

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