# intervalEngulfsDate

Industry: Core

## Signature

```ts
intervalEngulfsDate(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 day 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 `intervalContainsDate(aStart, aEnd, bStart, bEnd)`.
- Uses `Temporal.PlainDate.compare` for comparison.
- Returns `false` if either interval is invalid (`start > end`).
- Returns `false` on invalid input (wrong type, malformed strings).
- Accepts RFC 9557 calendar-annotated PlainDate strings — E5 (issue #78). Ordering is calendar-independent, so arguments may carry different or no calendar tags.
- Compatibility: since 1.16.0 calendar strings are RFC 9557 (ISO digits, `[u-ca=<id>]`, canonical calendar ids); see `isValidCalendarDate`.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `aStart` | `string` | ISO 8601 date string for the outer interval start, optionally calendar-annotated |
| `aEnd` | `string` | ISO 8601 date string for the outer interval end (excluded), optionally calendar-annotated |
| `bStart` | `string` | ISO 8601 date string for the inner interval start, optionally calendar-annotated |
| `bEnd` | `string` | ISO 8601 date string for the inner interval end (excluded), optionally calendar-annotated |

## Returns

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

## Examples

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

intervalEngulfsDate("2024-01-01", "2024-12-31", "2024-06-01", "2024-07-01") // true
```

## Source

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