# intervalsOverlapDate

Industry: Core

## Signature

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

Return true when the half-open date intervals `[aStart, aEnd)` and `[bStart, bEnd)` share at least one day.

- Half-open: an interval holds every date `d` with `start <= d < end`, so `end` itself is not in it (the rule CORE-6's `intervalsOverlap` uses). The test is `aStart < bEnd && bStart < aEnd`.
- Touching intervals (`aEnd` equal to `bStart`) share no day and do not overlap.
- An empty interval (`start === end`) overlaps only an interval it lies strictly inside.
- 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 first interval start, optionally calendar-annotated |
| `aEnd` | `string` | ISO 8601 date string for the first interval end (excluded), optionally calendar-annotated |
| `bStart` | `string` | ISO 8601 date string for the second interval start, optionally calendar-annotated |
| `bEnd` | `string` | ISO 8601 date string for the second interval end (excluded), optionally calendar-annotated |

## Returns

true if intervals overlap, or false on invalid input

## Examples

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

intervalsOverlapDate("2024-01-01", "2024-06-30", "2024-04-01", "2024-12-31") // true
```

## Source

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